* allow null parameter

This commit is contained in:
Reinhard Pointner 2014-04-28 04:31:10 +00:00
parent a8e52145f4
commit b315e9e9ea
1 changed files with 4 additions and 1 deletions

View File

@ -182,9 +182,12 @@ public class ExpressionFormatMethods {
}
/**
* Find MatchResult that matches the given pattern (case-insensitive)
* Find a matcher that matches the given pattern (case-insensitive)
*/
public static Matcher findMatch(String self, String pattern) {
if (pattern == null)
return null;
Matcher matcher = compile(pattern, CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS).matcher(self);
return matcher.find() ? matcher.reset() : null;
}