You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
case 'E' or 'e':
- if ((uint)slice.Length < 5 ||+ if (slice.Length < 5 ||
!slice.Slice(1).StartsWith("rror", StringComparison.OrdinalIgnoreCase)) // Match the string "rror" (ordinal case-insensitive)
{
goto CaptureBacktrack7;
case 'W' or 'w':
- if ((uint)slice.Length < 7 ||+ if (slice.Length < 7 ||
!slice.Slice(1).StartsWith("arning", StringComparison.OrdinalIgnoreCase)) // Match the string "arning" (ordinal case-insensitive)
{
goto CaptureBacktrack7;
// Match with 2 alternative expressions.
//{
- if ((uint)slice.Length < 2)+ if (slice.Length < 2)
{
goto CaptureBacktrack1;
}
{
case 'E' or 'e':
- if ((uint)slice.Length < 6 ||+ if (slice.Length < 6 ||
!slice.Slice(2).StartsWith("rror", StringComparison.OrdinalIgnoreCase)) // Match the string "rror" (ordinal case-insensitive)
{
goto CaptureBacktrack1;
case 'W' or 'w':
- if ((uint)slice.Length < 8 ||+ if (slice.Length < 8 ||
!slice.Slice(2).StartsWith("arning", StringComparison.OrdinalIgnoreCase)) // Match the string "arning" (ordinal case-insensitive)
{
goto CaptureBacktrack1;
return false; // The input didn't match.
}
- if ((uint)slice.Length < 2 ||+ if (slice.Length < 2 ||
!char.IsAsciiLetter(slice[0]) || // Match a character in the set [A-Za-z].
slice[1] != ':') // Match ':'.
{
char ch;
ReadOnlySpan<char> slice = inputSpan.Slice(pos);
- if ((uint)slice.Length < 3 ||+ if (slice.Length < 3 ||
((ch = slice[0]) < 128 ? ("\0\0\0\0綮ﭝ綯͝"[ch >> 4] & (1 << (ch & 0xF))) == 0 : !RegexRunner.CharInClass((char)ch, "\0\u0004\0A{KÅ\0 \0DEFGIJOPQRUVWXZ[defgijopqruvwxz{")) || // Match a character in the set [A-z\u212A-[DFIOQUWZdfioquwz]].
!char.IsDigit(slice[1]) || // Match a Unicode digit.
((ch = slice[2]) < 128 ? ("\0\0\0\0綮\uffdd綯ߝ"[ch >> 4] & (1 << (ch & 0xF))) == 0 : !RegexRunner.CharInClass((char)ch, "\0\u0004\0A{KÅ\0\u0018\0DEFGIJOPQRUVdefgijopqruv"))) // Match a character in the set [A-z\u212A-[DFIOQUdfioqu]].
pos += iteration;
}
- if ((uint)slice.Length < 6 ||+ if (slice.Length < 6 ||
!char.IsDigit(slice[3]) || // Match a Unicode digit.
((ch = slice[4]) < 128 ? ("\0\0\0\0綮\uffdd綯ߝ"[ch >> 4] & (1 << (ch & 0xF))) == 0 : !RegexRunner.CharInClass((char)ch, "\0\u0004\0A{KÅ\0\u0018\0DEFGIJOPQRUVdefgijopqruv")) || // Match a character in the set [A-z\u212A-[DFIOQUdfioqu]].
!char.IsDigit(slice[5])) // Match a Unicode digit.
// Match a character in the set [0-9a-f] exactly 32 times.
{
- if ((uint)slice.Length < 32)+ if (slice.Length < 32)
{
return false; // The input didn't match.
}
conststringJsonPath="RegexResults-613.json";if(!File.Exists(JsonPath)){awaitusingvararchiveStream=awaitnewHttpClient().GetStreamAsync("https://runtimeutils.blob.core.windows.net/artifacts/3144cd93937a4aa0a575c59ed441faae/Results.zip");usingvararchive=newZipArchive(archiveStream,ZipArchiveMode.Read);archive.Entries.First(e =>e.Name=="Results.json").ExtractToFile(JsonPath);}usingFileStreamjsonFileStream=File.OpenRead(JsonPath);RegexEntry[]entries=JsonSerializer.Deserialize<RegexEntry[]>(jsonFileStream)!;Console.WriteLine($"Working with {entries.Length} patterns");recordKnownPattern(stringPattern,RegexOptionsOptions,intCount);sealedclassRegexEntry{publicrequiredKnownPatternRegex{get;set;}publicrequiredstringMainSource{get;set;}publicrequiredstringPrSource{get;set;}publicstring?FullDiff{get;set;}publicstring?ShortDiff{get;set;}publicstring[]?SearchValuesOfChar{get;set;}public(string[]Values,StringComparisonComparisonType)[]?SearchValuesOfString{get;set;}}
Job completed in 11 minutes 29 seconds.
Using arguments:
regexdiff -SkipJitDiff -UploadTestAssembly -NoPRLink
Examples of GeneratedRegex source diffs
"\\s+" (24455 uses)
"[^'\",]+'[^^']+'|[^'\",]+\"[^\"]+\"|[^,]+" (21563 uses)
"(?:,\"|^\")(\"\"|[\\w\\W]*?)(?=\",|\"$)|(?:, ..." (18474 uses)
"\\s" (10990 uses)
"^\\s*(((?<ORIGIN>(((\\d+>)?[a-zA-Z]?:[^:]*)| ..." (7826 uses)
"^\\s*(?<ORIGIN>(?<FILENAME>.*):(?<LOCATION>( ..." (7826 uses)
"^[A-Za-z]:" (5756 uses)
"[A-z-[dDfFiIoOqQuUwWzZ]]\\d[A-z-[dDfFiIoOqQu ..." (5703 uses)
"\\d{5}$|\\d{5}-\\d{4}$" (5703 uses)
"^[a-f0-9]{32}$" (4920 uses)
For more diff examples, see https://gist.github.com/MihuBot/74fd371c36382a07aa7fb19d08c970e7
Sample source code for further analysis
Artifacts:
The text was updated successfully, but these errors were encountered: