@Test public void works_with_slash_which_doesnt_need_escaping_in_java() { TreeRegexp tr = new TreeRegexp("^I go to '/(.+)'$"); Group g = tr.match("I go to '/hello'"); assertEquals(1, g.getChildren().size()); }
Group match(CharSequence s) { final Matcher matcher = pattern.matcher(s); if (!matcher.matches()) return null; return groupBuilder.build(matcher, IntStream.rangeClosed(0, matcher.groupCount()).iterator()); }
TreeRegexp { Group match(CharSequence s) { final Matcher matcher = pattern.matcher(s); if (!matcher.matches()) return null; return groupBuilder.build(matcher, IntStream.rangeClosed(0, matcher.groupCount()).iterator()); } }
TreeRegexp { Group match(CharSequence s) { final Matcher matcher = pattern.matcher(s); if (!matcher.matches()) return null; return groupBuilder.build(matcher, IntStream.rangeClosed(0, matcher.groupCount()).iterator()); } TreeRegexp(String regexp);   TreeRegexp(Pattern pattern); }
TreeRegexp { Group match(CharSequence s) { final Matcher matcher = pattern.matcher(s); if (!matcher.matches()) return null; return groupBuilder.build(matcher, IntStream.rangeClosed(0, matcher.groupCount()).iterator()); } TreeRegexp(String regexp);   TreeRegexp(Pattern pattern); GroupBuilder getGroupBuilder(); }
TreeRegexp { Group match(CharSequence s) { final Matcher matcher = pattern.matcher(s); if (!matcher.matches()) return null; return groupBuilder.build(matcher, IntStream.rangeClosed(0, matcher.groupCount()).iterator()); } TreeRegexp(String regexp);   TreeRegexp(Pattern pattern); GroupBuilder getGroupBuilder();  }