public static void test_backref() { var context = new Context("aaaaab"); var chara = new Character('a'); var lazya = new Lazy(chara, 1); var cap1 = new CaptureGroup(lazya, 1); var back1 = new Backreference(cap1); var list = new List(new IMatch[] { cap1, back1 }); // ((a+?)\1) ExecTest(context, list); }
public static void test_lazyalternate() { var context = new Context("aaaaa"); var chara = new Character('a'); var list2a = new List(new IMatch[] { chara, chara }); var alt = new Alternate(new IMatch[] { chara, list2a }); var lazy = new Lazy(alt, 1, 2); // (a|aa){1,2}? ExecTest(context, lazy); }
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); }
public static void test_lazy() { var context = new Context("aaaaa"); var chara = new Character('a'); var lazy = new Lazy(chara, 2, 4); // (a{2,4}?) ExecTest(context, lazy); }