How to get the startIndex and endIndex of match results?

Open
#73 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
tooling

Research direction

Start by reading the public API around the test and testExact methods, then inspect how Java regular-expression match results expose iteration, indexes, and groups. Determine whether the requested details fit the existing API; done would include a documented way to access them and tests covering multiple matches and group information.

Written by the indexing model from the issue text.

Description

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!

Dominant language
Java
Stars
2.6k
Forks
243
Avg merge
26m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from VerbalExpressions/JavaVerbalExpressions

All issues in VerbalExpressions/JavaVerbalExpressions

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.