Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the startIndex and endIndex of match results? #73

Open
josdejong opened this issue Oct 25, 2019 · 1 comment
Open

How to get the startIndex and endIndex of match results? #73

josdejong opened this issue Oct 25, 2019 · 1 comment

Comments

@josdejong
Copy link

josdejong commented Oct 25, 2019

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!

@josdejong josdejong changed the title How to find the location of a match result? How to get the startIndex and endIndex of match results? Oct 25, 2019
@josdejong
Copy link
Author

josdejong commented Oct 28, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant