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
I've noticed that the System.Text.RegularExpressions namespace is using Span for some processes.
And was thinking possibly a fundamental change is in order for string?
Operations like .Trim(), or even the .Value of Capture should return a ReadOnlySpan<char> or at least have exposed access like .AsSpan().
Thoughts?
The text was updated successfully, but these errors were encountered:
Right there is room for optimization. There are a few ideas and a few open PRs. One i.e. will go into 3.0 as it's a low risk change and doesn't affect the internals of the existing engine too much: dotnet/corefx#32949.
There is another PR which changes the Interpreter to operate on Span instead which showed promising results but hadn't had time yet to refine it and fine a solution for the compiled side: ViktorHofer/corefx#3. This also contains the .Value change you mentioned.
I was thinking it possible to write an entire set of extensions around Span<char> like .Split() where but might be totally fine to use some of them completely flexible of value type.
Capture has a ValueSpan property in. NET 6, and in .NET 7 we've added span-based IsMatch and Count methods, and #65011 tracks additional span-based API on regex. Thanks.
I've noticed that the System.Text.RegularExpressions namespace is using Span for some processes.
And was thinking possibly a fundamental change is in order for string?
Operations like
.Trim()
, or even the.Value
ofCapture
should return aReadOnlySpan<char>
or at least have exposed access like .AsSpan().Thoughts?
The text was updated successfully, but these errors were encountered: