-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
We rewrote the entirety of the code generation (RegexOptions.Compiled and the source generator) for Regex in .NET 7. The only thing the old code generation was still being used for was supporting RegexOptions.RightToLeft, and so we decided to fall back to the interpreter for RightToLeft and delete all of that older code generation (if you specify RegexOptions.Compiled | RegexOptions.RightToLeft, the Compiled part will just be ignored). There's nothing fundamental that prevents us from adding RegexOptions.RightToLeft support to the newer code generation, it's just non-trivial work for little perceived gain (RightToLeft use is very rare). If, however, it turns out compilation support for RightToLeft is warranted, we could add such support into both RegexCompiler and the source generator.
#62318 is the PR deleting the old code generation. Should we want to add RightToLeft support to the newer code generation, parts of that PR may be reverted to bring back the functional FindFirstChar override implementation; it's the generated Go override that needs to be rewritten from scratch.