@Test public void testSimplePattern() { PatternMatcher pm = new RegExPatternMatcher(); String pattern = "a*b"; String test = "aaaaaaab"; Pattern.compile(pattern); assertTrue(pm.matches(pattern, test)); }
public boolean matches(String pattern, String source) { if (pattern == null) { throw new IllegalArgumentException("pattern argument cannot be null."); } Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(source); return m.matches(); }
RegExPatternMatcher implements PatternMatcher { public boolean matches(String pattern, String source) { if (pattern == null) { throw new IllegalArgumentException("pattern argument cannot be null."); } Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(source); return m.matches(); } }
RegExPatternMatcher implements PatternMatcher { public boolean matches(String pattern, String source) { if (pattern == null) { throw new IllegalArgumentException("pattern argument cannot be null."); } Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(source); return m.matches(); }  }
RegExPatternMatcher implements PatternMatcher { public boolean matches(String pattern, String source) { if (pattern == null) { throw new IllegalArgumentException("pattern argument cannot be null."); } Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(source); return m.matches(); }  boolean matches(String pattern, String source); }
RegExPatternMatcher implements PatternMatcher { public boolean matches(String pattern, String source) { if (pattern == null) { throw new IllegalArgumentException("pattern argument cannot be null."); } Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(source); return m.matches(); }  boolean matches(String pattern, String source);  }