JavaVerbalExpressions
JavaVerbalExpressions copied to clipboard
How to get the startIndex and endIndex of match results?
I have to find all occurrences of dates in an email: each occurrence and the startIndex and endIndex of the occurrence. I would like to use a human-readable regex builder like JavaVerbalExpressions, but looking at the API I see no way to extract the match details like startIndex and endIndex, I only see test
and testExact
returning a boolean.
Is it possible to loop over all matches and get the start and end indexes and all match details (group names etc)? Thanks!
I see the VerbalExpression
class has an internal Pattern pattern
property, I think exposing this pattern
via a getter would give me all freedom to fine all matches and the start and end indexes.