Exemplo n.º 1
0
        static string ReadUnicodeCategoryName(RegExpPokeableReader reader)
        {
            if (reader.Read() != 0x7b)
            {
                throw new ArgumentException(@"Incorrect mask: '{' expected after '\p' or '\P'");
            }
            string str = string.Empty;

            while (true)
            {
                int num = reader.Read();
                switch (num)
                {
                case -1:
                    throw new ArgumentException(@"Incorrect mask: '}' expected after '\p{unicode_category_name' or '\P{unicode_category_name'");

                case 0x7d:
                    return(str);
                }
                str = str + ((char)num);
            }
        }
Exemplo n.º 2
0
        static char ReadCharCharCode(RegExpPokeableReader reader, int digitsWanted)
        {
            string s = string.Empty;

            for (int i = 0; i < digitsWanted; i++)
            {
                int num2 = reader.Read();
                if (num2 == -1)
                {
                    break;
                }
                s = s + ((char)num2);
            }
            return((char)int.Parse(s, NumberStyles.HexNumber));
        }