-
-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
The following code snippet leads to an endless loop in matcher.namedGroups()
and eventually to an OutOfMemoryError:
com.google.code.regexp.Matcher matcher = com.google.code.regexp.Pattern.compile("(?<foo>.*)").matcher("bar");
System.out.println(matcher.namedGroups());
Tested with v0.2.6
I would expect that
- the expression
(?<foo>.*)
matched the whole Stringbar
once, because.*
is greedy (as opposed to.*?
) - no endless loop / OOME occurs, for any given pattern
theodiefenthal
Metadata
Metadata
Assignees
Labels
No labels