Helper: does match starting at start, with RE2 anchor flag.
(int startByte, int anchor)
| 365 | |
| 366 | /** Helper: does match starting at start, with RE2 anchor flag. */ |
| 367 | private boolean genMatch(int startByte, int anchor) { |
| 368 | // TODO(rsc): Is matches/lookingAt supposed to reset the append or input positions? |
| 369 | // From the JDK docs, looks like no. |
| 370 | boolean ok = pattern.re2().match(matcherInput, startByte, inputLength, anchor, groups, 1); |
| 371 | if (!ok) { |
| 372 | return false; |
| 373 | } |
| 374 | hasMatch = true; |
| 375 | hasGroups = false; |
| 376 | anchorFlag = anchor; |
| 377 | |
| 378 | return true; |
| 379 | } |
| 380 | |
| 381 | /** Helper: return substring for [start, end). */ |
| 382 | String substring(int start, int end) { |