mainly theoratical work on semi, add regex sample

This commit is contained in:
Youmu Liu
2026-07-27 18:11:31 +08:00
parent a74ebcd0b7
commit ac1e7c68f8
5 changed files with 91 additions and 6 deletions
+44
View File
@@ -122,3 +122,47 @@ static void Match_AB_2_3(ReadOnlySpan<char> input)
} while(false);
}
// (ab|[cd]|.)x
static void MatchDiffCase(ReadOnlySpan<char> seq)
{
/*
* [000] 0001, DEF , Sccs, NONE, 0000, MATCH_SEQ "ab"
* [001] 0001, Fail, Sccs, LINE, 0000, MATCH_SET "[cd]"
* [002] 0001, Fail, Sccs, LINE, 0001, MATCH_SET "."
* [003] 0000, Fail, DEF , LINE, 0002, POP FAIL
* [004] 0000, DEF , DEF , NONE, 0000, MATCH_SEQ "x"
*/
int ptr = 0;
if(seq.StartsWith("ab"))
{
ptr+=2;
}
else if((seq[0] == 'c' || seq[0] == 'd'))
{
ptr+=1;
}
else if(true)
{
ptr+=1;
}
else
{
return;
}
}
// (?<name>.*)x
static void MatchCountAnyGroup(ReadOnlySpan<char> seq)
{
/*
* [000] 0001, DEF , DEF , NONE, 0000, FIND_COMPLEX FURTHEST COUNT: -1
* [001] 0001, Sccs, DEF , LINE, 0000, PACK SUCCESS GROUP: "name"
* [002] 0000, DEF , DEF , NONE, 0000, MATCH_SEQ "234"
*/
int ptr = 0;
}
+1 -1
View File
@@ -21,7 +21,7 @@ namespace StgSharp
{
private static string[] regexSource = [
@"(?<name>123)(?<name>123)",
@"(?<name>.*)234",
/*
@"http|https|ftp|ftps",
@"abc[0-9]x|abc[0-9]y|abd[0-9]x|abd[0-9]y|xyz",