#88400 updates regex to use SearchValues<string> for multi-substring search. But SearchValues<string> is also able to optimize single-substring search beyond what IndexOf(span, StringComparison.Ordinal{IgnoreCase}) does, as it can precompute and analyze more. We should update the Regex source generator (and possibly the RegexCompiler, although the equation for it is a bit different, as there's a little more overhead for the compiler to access a cached SearchValues<string>) to use SearchValues<string> for some of the places where it searches for a string, in particular the next-starting-position search.
#88400 updates regex to use
SearchValues<string>for multi-substring search. ButSearchValues<string>is also able to optimize single-substring search beyond whatIndexOf(span, StringComparison.Ordinal{IgnoreCase})does, as it can precompute and analyze more. We should update the Regex source generator (and possibly the RegexCompiler, although the equation for it is a bit different, as there's a little more overhead for the compiler to access a cachedSearchValues<string>) to useSearchValues<string>for some of the places where it searches for a string, in particular the next-starting-position search.