Broaden use of SearchValues in TryFindNextPossibleStartingPosition in Regex (#89205)
authorStephen Toub <stoub@microsoft.com>
Thu, 20 Jul 2023 13:23:23 +0000 (09:23 -0400)
committerGitHub <noreply@github.com>
Thu, 20 Jul 2023 13:23:23 +0000 (09:23 -0400)
commit0ccbbe71318c9b5024f0c93ec304d2b4fa476c43
treea3eb04263f272a0c12f965b8a020d8fd4a56f3e0
parent84b7c6139227703f111037ba7a0e4abb1af8a76f
Broaden use of SearchValues in TryFindNextPossibleStartingPosition in Regex (#89205)

SearchValues has been updated to have an ASCII fast-path for inputs that are not only ASCII.  This means we can simplify TryFindNextPossibleStartingPosition in Regex to not track AsciiSet specially and instead just increase the number of characters we query the set for (from 5 to 128).  That way, we'll use SearchValues rather than emitting our own helper up until a (semi-arbitrary) point where we deem it impossible or infeasible to enumerate all the chars that make up the set.
src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexPrefixAnalyzer.cs