@Test public void testToJavaRegexWithCharacterClassNegation() { assertThat(toJavaRegex("[!a-c]"), equalTo("[^a-c]")); assertThat(toJavaRegex("[!qwerty]"), equalTo("[^qwerty]")); assertThat(toJavaRegex("test[!4]"), equalTo("test[^4]")); }
public static String toJavaRegex(String wildcard) { GroupWildcard parser = Parboiled.createParser(GroupWildcard.class); BasicParseRunner<String> runner = new BasicParseRunner<>(parser.TopLevel()); ParsingResult<String> result = runner.run(wildcard); if (!result.matched) { throw new IllegalArgumentException("Unhandled input: " + wildcard); } return result.resultValue; }
GroupWildcard extends BaseParser<String> { public static String toJavaRegex(String wildcard) { GroupWildcard parser = Parboiled.createParser(GroupWildcard.class); BasicParseRunner<String> runner = new BasicParseRunner<>(parser.TopLevel()); ParsingResult<String> result = runner.run(wildcard); if (!result.matched) { throw new IllegalArgumentException("Unhandled input: " + wildcard); } return result.resultValue; } }
GroupWildcard extends BaseParser<String> { public static String toJavaRegex(String wildcard) { GroupWildcard parser = Parboiled.createParser(GroupWildcard.class); BasicParseRunner<String> runner = new BasicParseRunner<>(parser.TopLevel()); ParsingResult<String> result = runner.run(wildcard); if (!result.matched) { throw new IllegalArgumentException("Unhandled input: " + wildcard); } return result.resultValue; }  }
GroupWildcard extends BaseParser<String> { public static String toJavaRegex(String wildcard) { GroupWildcard parser = Parboiled.createParser(GroupWildcard.class); BasicParseRunner<String> runner = new BasicParseRunner<>(parser.TopLevel()); ParsingResult<String> result = runner.run(wildcard); if (!result.matched) { throw new IllegalArgumentException("Unhandled input: " + wildcard); } return result.resultValue; }  static String toJavaRegex(String wildcard); }
GroupWildcard extends BaseParser<String> { public static String toJavaRegex(String wildcard) { GroupWildcard parser = Parboiled.createParser(GroupWildcard.class); BasicParseRunner<String> runner = new BasicParseRunner<>(parser.TopLevel()); ParsingResult<String> result = runner.run(wildcard); if (!result.matched) { throw new IllegalArgumentException("Unhandled input: " + wildcard); } return result.resultValue; }  static String toJavaRegex(String wildcard);  }