Resolve regex groups when performing match opertion in one pass.
- Dominant language
- Java
- Stars
- 1.3k
- Forks
- 165
- PR merge metrics
- No merged PRs in 30d
Description
By default, RE2J does not resolve all the groups when performing a match operation, rather it only resolves groups when `Matcher.group(*)` is called. This results in input being processed twice. Once during [find()](https://github.com/google/re2j/blob/master/java/com/google/re2j/Matcher.java#L352) and then again during [group(*)](https://github.com/google/re2j/blob/master/java/com/google/re2j/Matcher.java#L285). This increase the latency when `Matcher.find()` and `Matcher.group(*)` are called in succession.
The request here is to allow resolving all the regex groups when `Matcher.find()` is called, such that when `Matcher.group(*)` is called, the groups can be served from cache.
Pull Request and Performance results are here : https://github.com/google/re2j/pull/178
Contributor guide
Assessment
This issue has not been assessed yet.