-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have RegexInterpreter work over ReadOnlySpan<char> instead of strings. #62165
Conversation
Tagging subscribers to this area: @eerhardt, @dotnet/area-system-text-regularexpressions Issue DetailsContributes to #59629 After chatting with @stephentoub offline, the approach we want to take to add support of spans on Regex will start by having the current engines move to working over Spans instead of strings. Once we have moved all engines do this, then we can add public surface area that takes in user spans, as opposed to strings. This first PR is making it so the RegexInterpreter engine no longer uses the runtext string, other than in FindFirstChar and Go methods for getting the actual Span out, which is used in the rest of the implementation.
|
...raries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs
Outdated
Show resolved
Hide resolved
.../System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs
Show resolved
Hide resolved
...raries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs
Outdated
Show resolved
Hide resolved
...raries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we're off :)
Contributes to #59629
After chatting with @stephentoub offline, the approach we want to take to add support of spans on Regex will start by having the current engines move to working over Spans instead of strings. Once we have moved all engines do this, then we can add public surface area that takes in user spans, as opposed to strings.
This first PR is making it so the RegexInterpreter engine no longer uses the runtext string, other than in FindFirstChar and Go methods for getting the actual Span out, which is used in the rest of the implementation.
cc: @stephentoub @danmoseley