@Test public void testRegexDeprecated() { CommonParser parser = CommonParser.instance(); Rule rule = parser.input(parser.RegexDeprecated()); assertTrue(matches(".*", rule)); assertTrue(matches("host.*", rule)); assertTrue(matches("as1-.*", rule)); assertTrue(matches(".*-b", rule)); assertTrue(matches(".*border.*", rule)); assertFalse(matches("has space", rule)); assertFalse(matches("@start", rule)); assertFalse(matches("1startDigit", rule)); assertFalse(matches("/startSlash", rule)); assertFalse(matches("has[", rule)); assertFalse(matches("has(", rule)); }
public Rule RegexDeprecated() { return Sequence( TestNot('"'), TestNot(Digit()), TestNot(Slash()), Sequence( OneOrMore(AsciiButNot(SPECIAL_CHARS + "*")), "*", ZeroOrMore(AsciiButNot(SPECIAL_CHARS))), push(new RegexAstNode(match()))); }
CommonParser extends BaseParser<AstNode> { public Rule RegexDeprecated() { return Sequence( TestNot('"'), TestNot(Digit()), TestNot(Slash()), Sequence( OneOrMore(AsciiButNot(SPECIAL_CHARS + "*")), "*", ZeroOrMore(AsciiButNot(SPECIAL_CHARS))), push(new RegexAstNode(match()))); } }
CommonParser extends BaseParser<AstNode> { public Rule RegexDeprecated() { return Sequence( TestNot('"'), TestNot(Digit()), TestNot(Slash()), Sequence( OneOrMore(AsciiButNot(SPECIAL_CHARS + "*")), "*", ZeroOrMore(AsciiButNot(SPECIAL_CHARS))), push(new RegexAstNode(match()))); }  }
CommonParser extends BaseParser<AstNode> { public Rule RegexDeprecated() { return Sequence( TestNot('"'), TestNot(Digit()), TestNot(Slash()), Sequence( OneOrMore(AsciiButNot(SPECIAL_CHARS + "*")), "*", ZeroOrMore(AsciiButNot(SPECIAL_CHARS))), push(new RegexAstNode(match()))); }  Rule input(Rule expression); Rule AlphabetChar(); @Anchor(Type.IGNORE) Rule AsciiButNot(String characters); Rule At(); Rule Dash(); Rule Digit(); Rule Dot(); Rule EnumValue(); Rule EscapeChar(); @Anchor(Type.IGNORE) Rule EscapedSlash(); @Anchor(Type.IGNORE) Rule EscapedQuote(); Rule IpAddressUnchecked(); Rule IpPrefixUnchecked(); Rule NameLiteral(); Rule Number(); @Anchor(OPERATOR_END) Rule CloseBrackets(); @Anchor(OPERATOR_END) Rule CloseParens(); Rule Regex(); Rule RegexDeprecated(); Rule Slash(); Rule Tilde(); Rule Underscore(); @Anchor(Type.WHITESPACE) Rule WhiteSpace(); }
CommonParser extends BaseParser<AstNode> { public Rule RegexDeprecated() { return Sequence( TestNot('"'), TestNot(Digit()), TestNot(Slash()), Sequence( OneOrMore(AsciiButNot(SPECIAL_CHARS + "*")), "*", ZeroOrMore(AsciiButNot(SPECIAL_CHARS))), push(new RegexAstNode(match()))); }  Rule input(Rule expression); Rule AlphabetChar(); @Anchor(Type.IGNORE) Rule AsciiButNot(String characters); Rule At(); Rule Dash(); Rule Digit(); Rule Dot(); Rule EnumValue(); Rule EscapeChar(); @Anchor(Type.IGNORE) Rule EscapedSlash(); @Anchor(Type.IGNORE) Rule EscapedQuote(); Rule IpAddressUnchecked(); Rule IpPrefixUnchecked(); Rule NameLiteral(); Rule Number(); @Anchor(OPERATOR_END) Rule CloseBrackets(); @Anchor(OPERATOR_END) Rule CloseParens(); Rule Regex(); Rule RegexDeprecated(); Rule Slash(); Rule Tilde(); Rule Underscore(); @Anchor(Type.WHITESPACE) Rule WhiteSpace(); static Set<String> namedApplications; }