[GeneratedRegex("^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture)]
/// ○ Optional (greedy).<br/>
/// ○ Match a character in the set [\t ] atomically any number of times.<br/>
/// ○ Match the string "\r\n".<br/>
- /// ○ Match a character in the set [\t ] greedily at least once.<br/>
+ /// ○ Match a character in the set [\t ] atomically at least once.<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ Match a character in the set [\u0001-\b\v\f\u000E-\u001F!#-[]-\u007F\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF].<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Optional (greedy).<br/>
/// ○ Match a character in the set [\t ] atomically any number of times.<br/>
/// ○ Match the string "\r\n".<br/>
- /// ○ Match a character in the set [\t ] greedily at least once.<br/>
+ /// ○ Match a character in the set [\t ] atomically at least once.<br/>
/// ○ Match '"'.<br/>
/// ○ Match '@'.<br/>
/// ○ Loop greedily at least once.<br/>
int charloop_starting_pos = 0, charloop_ending_pos = 0;
int charloop_starting_pos1 = 0, charloop_ending_pos1 = 0;
int charloop_starting_pos2 = 0, charloop_ending_pos2 = 0;
- int charloop_starting_pos3 = 0, charloop_ending_pos3 = 0;
- int charloop_starting_pos4 = 0, charloop_ending_pos4 = 0;
int loop_iteration = 0;
int loop_iteration1 = 0;
int loop_iteration2 = 0;
LoopSkipBacktrack:;
//}
- // Match a character in the set [\t ] greedily at least once.
- //{
- charloop_starting_pos1 = pos;
-
+ // Match a character in the set [\t ] atomically at least once.
+ {
int iteration3 = slice.IndexOfAnyExcept('\t', ' ');
if (iteration3 < 0)
{
slice = slice.Slice(iteration3);
pos += iteration3;
-
- charloop_ending_pos1 = pos;
- charloop_starting_pos1++;
- goto CharLoopEnd1;
-
- CharLoopBacktrack1:
- Utilities.StackPop(base.runstack!, ref stackpos, out charloop_ending_pos1, out charloop_starting_pos1);
-
- if (Utilities.s_hasTimeout)
- {
- base.CheckTimeout();
- }
-
- if (charloop_starting_pos1 >= charloop_ending_pos1)
- {
- goto LoopBacktrack;
- }
- pos = --charloop_ending_pos1;
- slice = inputSpan.Slice(pos);
-
- CharLoopEnd1:
- Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos1, charloop_ending_pos1);
- //}
+ }
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
// No iterations of the loop remain to backtrack into. Fail the loop.
goto LoopIterationNoMatch1;
}
- goto CharLoopBacktrack1;
+ goto LoopBacktrack;
LoopEnd2:
Utilities.StackPush(ref base.runstack!, ref stackpos, loop_iteration2);
LoopSkipBacktrack2:;
//}
- // Match a character in the set [\t ] greedily at least once.
- //{
- charloop_starting_pos2 = pos;
-
+ // Match a character in the set [\t ] atomically at least once.
+ {
int iteration5 = slice.IndexOfAnyExcept('\t', ' ');
if (iteration5 < 0)
{
slice = slice.Slice(iteration5);
pos += iteration5;
-
- charloop_ending_pos2 = pos;
- charloop_starting_pos2++;
- goto CharLoopEnd2;
-
- CharLoopBacktrack2:
- Utilities.StackPop(base.runstack!, ref stackpos, out charloop_ending_pos2, out charloop_starting_pos2);
-
- if (Utilities.s_hasTimeout)
- {
- base.CheckTimeout();
- }
-
- if (charloop_starting_pos2 >= charloop_ending_pos2)
- {
- goto LoopBacktrack4;
- }
- pos = --charloop_ending_pos2;
- slice = inputSpan.Slice(pos);
-
- CharLoopEnd2:
- Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos2, charloop_ending_pos2);
- //}
+ }
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
// No iterations of the loop remain to backtrack into. Fail the loop.
goto LoopBacktrack3;
}
- goto CharLoopBacktrack2;
+ goto LoopBacktrack4;
LoopEnd4:;
//}
//{
pos++;
slice = inputSpan.Slice(pos);
- charloop_starting_pos3 = pos;
+ charloop_starting_pos1 = pos;
int iteration6 = 0;
while ((uint)iteration6 < (uint)slice.Length && ((ch = slice[iteration6]) < 128 ? ("\0\0怀Ͽ\ufffe蟿\ufffe䟿"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\0\u0010\u0001-/A[_`a{~\u007f \ud800豈\ufdd0ﷰ\ufff0\t")))
slice = slice.Slice(iteration6);
pos += iteration6;
- charloop_ending_pos3 = pos;
- goto CharLoopEnd3;
+ charloop_ending_pos1 = pos;
+ goto CharLoopEnd1;
- CharLoopBacktrack3:
- Utilities.StackPop(base.runstack!, ref stackpos, out charloop_ending_pos3, out charloop_starting_pos3);
+ CharLoopBacktrack1:
+ Utilities.StackPop(base.runstack!, ref stackpos, out charloop_ending_pos1, out charloop_starting_pos1);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
- if (charloop_starting_pos3 >= charloop_ending_pos3)
+ if (charloop_starting_pos1 >= charloop_ending_pos1)
{
goto LoopIterationNoMatch6;
}
- pos = --charloop_ending_pos3;
+ pos = --charloop_ending_pos1;
slice = inputSpan.Slice(pos);
- CharLoopEnd3:
- Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos3, charloop_ending_pos3);
+ CharLoopEnd1:
+ Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos1, charloop_ending_pos1);
//}
// Match a character in the set [A-Za-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\d].
if (slice.IsEmpty || ((ch = slice[0]) < 128 ? !char.IsAsciiLetterOrDigit(ch) : !RegexRunner.CharInClass((char)ch, "\0\n\u0001A[a{ \ud800豈\ufdd0ﷰ\ufff0\t")))
{
- goto CharLoopBacktrack3;
+ goto CharLoopBacktrack1;
}
Utilities.StackPush(ref base.runstack!, ref stackpos, 1, alternation_starting_pos2);
case 0:
goto AlternationBranch2;
case 1:
- goto CharLoopBacktrack3;
+ goto CharLoopBacktrack1;
}
AlternationMatch2:;
//{
pos++;
slice = inputSpan.Slice(pos);
- charloop_starting_pos4 = pos;
+ charloop_starting_pos2 = pos;
int iteration7 = 0;
while ((uint)iteration7 < (uint)slice.Length && ((ch = slice[iteration7]) < 128 ? ("\0\0怀Ͽ\ufffe蟿\ufffe䟿"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\0\u0010\u0001-/A[_`a{~\u007f \ud800豈\ufdd0ﷰ\ufff0\t")))
slice = slice.Slice(iteration7);
pos += iteration7;
- charloop_ending_pos4 = pos;
- goto CharLoopEnd4;
+ charloop_ending_pos2 = pos;
+ goto CharLoopEnd2;
- CharLoopBacktrack4:
+ CharLoopBacktrack2:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
- if (charloop_starting_pos4 >= charloop_ending_pos4)
+ if (charloop_starting_pos2 >= charloop_ending_pos2)
{
goto LoopBacktrack6;
}
- pos = --charloop_ending_pos4;
+ pos = --charloop_ending_pos2;
slice = inputSpan.Slice(pos);
- CharLoopEnd4:
+ CharLoopEnd2:
//}
// Match a character in the set [A-Za-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF].
if (slice.IsEmpty || ((ch = slice[0]) < 128 ? !char.IsAsciiLetter(ch) : !RegexRunner.CharInClass((char)ch, "\0\n\0A[a{ \ud800豈\ufdd0ﷰ\ufff0")))
{
- goto CharLoopBacktrack4;
+ goto CharLoopBacktrack2;
}
alternation_branch1 = 1;
case 0:
goto AlternationBranch3;
case 1:
- goto CharLoopBacktrack4;
+ goto CharLoopBacktrack2;
}
AlternationMatch3:;
Job completed in 18 minutes 49 seconds (remote runner delay: 1 minute 58 seconds).
dotnet/runtime#117943
Using arguments:
regexdiff699 out of 18857 patterns have generated source code changes.
Examples of GeneratedRegex source diffs
"(?<lang>[a-z]{2,8})(?:(?:\\-(?<script>[a-zA- ..." (5593 uses)
"^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_` ..." (4566 uses)
"{(?<env>env:)??\\w+(\\s+(\\?\\?)??\\s+\\w+)??}" (2282 uses)
"(<br>)+$" (119 uses)
For more diff examples, see https://gist.github.com/MihuBot/e5abb03a950ee125ee5dd26759e09907
For a list of JIT diff regressions, see Regressions.md
For a list of JIT diff improvements, see Improvements.md
Sample source code for further analysis
Artifacts: