(String name)
| 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. |
no test coverage detected