MCPcopy Create free account
hub / github.com/google/re2j / isValidCaptureName

Method isValidCaptureName

java/com/google/re2j/Parser.java:1151–1162  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

1149 // Python rejects names starting with digits.
1150 // We don't enforce either of those.
1151 private static boolean isValidCaptureName(String name) {
1152 if (name.isEmpty()) {
1153 return false;
1154 }
1155 for (int i = 0; i < name.length(); ++i) {
1156 char c = name.charAt(i);
1157 if (c != '_' && !Utils.isalnum(c)) {
1158 return false;
1159 }
1160 }
1161 return true;
1162 }
1163
1164 // parseInt parses a nonnegative decimal integer.
1165 // -1 => bad format. -2 => format ok, but integer overflow.

Callers 1

parsePerlFlagsMethod · 0.95

Calls 3

isalnumMethod · 0.95
isEmptyMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected