scanning min scan length
This commit is contained in:
@@ -10,6 +10,7 @@ using StgSharp.RegularAnalysis.Text;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.WebSockets;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
@@ -20,7 +21,7 @@ namespace StgSharp
|
||||
{
|
||||
|
||||
private static string[] regexSource = [
|
||||
@"(123(4|5)67){3,4}114514",
|
||||
@"(a|b)(c|d)",
|
||||
/**/
|
||||
@"http|https|ftp|ftps",
|
||||
@"abc[0-9]x|abc[0-9]y|abd[0-9]x|abd[0-9]y|xyz",
|
||||
@@ -44,18 +45,23 @@ namespace StgSharp
|
||||
Console.Write(new string('|', enumerator.Depth));
|
||||
Console.WriteLine($"\t{node.Source.Value}\t{node.Source.Flag}");
|
||||
}
|
||||
/*
|
||||
Console.WriteLine("-----IR-----");
|
||||
List<RegexIR> ir = interpreterSource.BaseIR;
|
||||
for (int i = 0; i < ir.Count; i++) {
|
||||
Console.WriteLine(ir[i].AsCommand(i));
|
||||
}
|
||||
/**/
|
||||
Console.WriteLine("-----Optimized once-----");
|
||||
List<RegexIR> opt_ir = interpreterSource.IRs;
|
||||
for (int i = 0; i < opt_ir.Count; i++) {
|
||||
Console.WriteLine(opt_ir[i].AsCommand(i));
|
||||
}
|
||||
Console.WriteLine(interpreterSource.AnalyseException?.ToString() ?? "No error");
|
||||
RegexInfo info = interpreterSource.Info;
|
||||
Console.WriteLine("-----Regex Info-----");
|
||||
Console.WriteLine($"Min length: {info.MinPredictLength}");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine(interpreterSource.AnalyseException);
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user