Beispiel #1
0
        public static Pattern EmailAddress()
        {
            QuantifiedGroup left = OneMany(Chars.Alphanumeric() + "!#$%&'*+/=?^_`{|}~-");

            QuantifiedGroup right = Maybe(MaybeMany(Chars.Alphanumeric() + "-") + Alphanumeric());

            return(NoncapturingGroup(
                       left
                       + MaybeMany("." + left)
                       + "@"
                       + OneMany(Alphanumeric() + right + ".")
                       + Alphanumeric()
                       + right));
        }
Beispiel #2
0
        public static Pattern CSharpCharacterLiteral()
        {
            QuantifiedGroup chars = MaybeMany(!Chars.Apostrophe().Backslash().NewLineChar());

            return(SurroundApostrophes(chars + MaybeMany(Backslash().NotNewLineChar() + chars)));
        }
Beispiel #3
0
        public static Pattern CSharpEscapedTextLiteral()
        {
            QuantifiedGroup chars = MaybeMany(!Chars.QuoteMark().Backslash().NewLineChar());

            return(SurroundQuoteMarks(chars + MaybeMany(Backslash().NotNewLineChar() + chars)));
        }