Example #1
0
        public void TestSerialization_SymbolicRegexMatcher()
        {
            var regex   = new Regex(@"[0-9]");
            var matcher = (SymbolicRegex <ulong>)regex.Compile();

            matcher.Serialize("matcher.bin");
            var matcher_ = SymbolicRegex <ulong> .Deserialize("matcher.bin");
        }
Example #2
0
        public void TestSerialization_StartAnchorBugFix()
        {
            var regex1   = new Regex(@"b|a{1,2}");
            var matcher1 = (SymbolicRegex <ulong>)regex1.Compile();

            matcher1.Serialize("test1.bin");
            var matcher1_ = SymbolicRegex <ulong> .Deserialize("test1.bin");

            ////---------------------
            //var regex2 = new Regex(@"b(ba|a)?b");
            //var matcher2 = (SymbolicRegexMatcher<BV>)regex2.Compile();
            //matcher2.Serialize("test2.bin");
            //var matcher2_ = SymbolicRegexMatcher<BV>.Deserialize("test2.bin");
            //---------------------
            //Assert.IsTrue(matcher1_.Pattern.Right.Left.Left.Kind == SymbolicRegexKind.Or);
            //Assert.IsTrue(matcher1_.Pattern.Right.Left.Left.OrCount == 2);
            ////---
            //var hs = new HashSet<SymbolicRegexNode<BV>>(matcher1_.Pattern.Right.Left.Left.Alts);
            ////matcher1_.Pattern.Right.Left.Left.ShowGraph(0,"m1");
            ////matcher2_.Pattern.Right.Left.Left.ShowGraph(0,"m2");
            //matcher2_.Pattern.ShowGraph(0, "p2");
        }