-
Notifications
You must be signed in to change notification settings - Fork 23
Description
In the method QueryPredicate.Match.test() (line 128), the regex currently uses java.util.regex.Matcher.hasMatch():
return pattern.matcher(text).hasMatch() == isPositive;
However according to the documentation, hasMatch() only indicates whether a previous match was found:
Returns whether this contains a valid match from a previous match or find operation.
Since the matcher is created on the fly and no match or find operation has been performed, this will always return false.
To correctly evaluate whether the entire input matches the pattern, the method matches() should be used instead, as per the Matcher documentation:
Attempts to match the entire region against the pattern.
Suggested fix:
return pattern.matcher(text).matches() == isPositive;
Oh, and thanks for your work !
Metadata
Metadata
Assignees
Labels
No labels