-
-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
It seems that if the pattern matches an empty string, an infinite loop occurs when using Matcher.namedGroups, even if the matched input isn't an empty string. Here's a code example:
Pattern pattern = Pattern.compile("(?<first>A)?(?<second>B)?");
Matcher matcher = pattern.matcher("AB");
if(matcher.matches()) {
matcher.namedGroups();
}
Metadata
Metadata
Assignees
Labels
No labels