/** * Compile a regular expression using the JDK implementation */ @Test public void testMatcher() { final RegExp regexp = new RegExpFactory().compile("f(o)o", ""); final RegExpMatcher matcher = regexp.match("foo"); assertNotNull(matcher); assertTrue(matcher.search(0)); assertEquals(matcher.getInput(), "foo"); assertEquals(matcher.groupCount(), 1); assertEquals(matcher.group(), "foo"); assertEquals(matcher.start(), 0); assertEquals(matcher.end(), 3); assertEquals(matcher.group(1), "o"); assertEquals(matcher.start(1), 1); assertEquals(matcher.end(1), 2); }
private RegExp getRegExp() { return regexp; }
private void setRegExp(final RegExp regexp) { this.regexp = regexp; }