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
Two-phase matching algorithm for NonBacktracking (dotnet#68199)
* Switch to 2-phase matching in NonBacktracking
First phase now finds the true match end position.
The implicit .* is now a lazy .*? to prioritize the earliest match.
Third phase is now only run for subcaptures, which no longer needs to
find match end position.
Remove counter optimization that no longer applies with OrderedOr.
Fix a problem in SymbolicRegexInfo where begin/end anchors were
marked as line anchors.
Also remove dead fields from SymbolicRegexInfo.
Fix captures not being handled for empty matches at start of input.
* Improve comments for NonBacktracking
Especially fix comments for the new 2-phase match generation algorithm.
* Add a failing test for the earlier NonBacktracking
* Avoid transitions to deadends for capuring NFA
Copy file name to clipboardExpand all lines: src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/DfaMatchingState.cs
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ internal int FixedLength
51
51
/// <summary>If true then the state is a dead-end, rejects all inputs.</summary>
52
52
internalboolIsNothing=>Node.IsNothing;
53
53
54
-
/// <summary>If true then state starts with a ^ or $ or \A or \z or \Z</summary>
54
+
/// <summary>If true then state starts with a ^ or $ or \Z</summary>
Copy file name to clipboardExpand all lines: src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexBuilder.cs
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ internal sealed class SymbolicRegexBuilder<TSet> where TSet : IComparable<TSet>
Copy file name to clipboardExpand all lines: src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexInfo.cs
0 commit comments