static int toUpper(int ch) { return isLower(ch) ? (ch - 0x20) : ch; }
static int toUpper(int ch) { return isLower(ch) ? (ch - 0x20) : ch; }
/** * Parses and returns the name of a "named capturing group", the trailing * ">" is consumed after parsing. */ private String groupname(int ch) { StringBuilder sb = new StringBuilder(); sb.append(Character.toChars(ch)); while (ASCII.isLower(ch=read()) || ASCII.isUpper(ch) || ASCII.isDigit(ch)) { sb.append(Character.toChars(ch)); } if (sb.length() == 0) throw error("named capturing group has 0 length name"); if (ch != '>') throw error("named capturing group is missing trailing '>'"); return sb.toString(); }
/** * Parses and returns the name of a "named capturing group", the trailing * ">" is consumed after parsing. */ private String groupname(int ch) { StringBuilder sb = new StringBuilder(); sb.append(Character.toChars(ch)); while (ASCII.isLower(ch=read()) || ASCII.isUpper(ch) || ASCII.isDigit(ch)) { sb.append(Character.toChars(ch)); } if (sb.length() == 0) throw error("named capturing group has 0 length name"); if (ch != '>') throw error("named capturing group is missing trailing '>'"); return sb.toString(); }
while (cursor < replacement.length()) { nextChar = replacement.charAt(cursor); if (ASCII.isLower(nextChar) || ASCII.isUpper(nextChar) || ASCII.isDigit(nextChar)) {
while (cursor < replacement.length()) { nextChar = replacement.charAt(cursor); if (ASCII.isLower(nextChar) || ASCII.isUpper(nextChar) || ASCII.isDigit(nextChar)) {
case '<': // (?<xxx) look behind ch = read(); if (ASCII.isLower(ch) || ASCII.isUpper(ch)) {
case '<': // (?<xxx) look behind ch = read(); if (ASCII.isLower(ch) || ASCII.isUpper(ch)) {