public class RegExPatternMatcher extends Objectimplements PatternMatcher
PatternMatcher implementation that uses standard
java.util.regex objects.
Pattern
| Constructor and Description |
|---|
RegExPatternMatcher()
|
public boolean matches(Stringpattern, String source)
Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(source); return m.matches();
matches in interface
PatternMatcher
pattern - the pattern to match against
source - the source to match
true if the source matches the required pattern,
false otherwise.