Beispiel #1
0
        public static void test_negative_lookbehind()
        {
            var context = new Context("abaab");
            var chara = new Character('a');
            var charb = new Character('b');
            var alt = new Alternate(new IMatch[] { chara, charb });
            var lazy = new Lazy(alt, 1);

            var backa = new Character('a', false);
            var back2a = new List(new IMatch[] { backa, backa }, false);
            var assert = new Lookaround(back2a, false);
            var list = new List(new IMatch[] { lazy, assert });

            // ((?:a|b)+?(?<!aa))
            ExecTest(context, list);
        }
Beispiel #2
0
        public static void test_negative_lookahead()
        {
            var context = new Context("aaaab");
            var chara = new Character('a');
            var greedy = new Greedy(chara, 1);
            var list2a = new List(new IMatch[] { chara, chara });
            var assert = new Lookaround(new CaptureGroup(list2a, 1), false);
            var list = new List(new IMatch[] { greedy, assert });

            // (a+(?!(aa))
            ExecTest(context, list);
        }