Skip to content
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

Access to more .NET flags, especially "Compiled" #2371

Open
Davidebyzero opened this issue Oct 26, 2024 · 0 comments
Open

Access to more .NET flags, especially "Compiled" #2371

Davidebyzero opened this issue Oct 26, 2024 · 0 comments

Comments

@Davidebyzero
Copy link
Collaborator

Davidebyzero commented Oct 26, 2024

Feature

Ideally all .NET regex flags should be accessible. The ones that currently aren't are Compiled, RightToLeft, ECMAScript, and CultureInvariant.

But RegexOptions.Compiled is especially important – I wouldn't much mind if this were the only flag added. It can make regexes run much faster.

It can even prevent certain errors from being thrown, for example in my regex that matches primes in decimal, without the Compiled flag, it throws an error on numbers ≥21, but with that flag, it works fine. (This can be worked around with a 4 byte longer regex, but that's beside the point.) Note though that some preliminary testing suggests that on the very latest version of .NET, a bug may prevent my regex from working properly in Compiled mode (matching every number instead of just primes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant