Skip to content

Matcher#namedGroups() returns only first matching subsequence #7

@wasiek

Description

@wasiek

given:

    Pattern pattern = Pattern.compile("(?<digit>\\d)(\\w)");
    Matcher matcher = pattern.matcher("2foo3bar4");

when

    matcher.namedGroups();

then
Only the first group is being found due to reseting of matcher.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions