-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Augment generated regex XML comment with original pattern and options #88175
Conversation
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions Issue DetailsFixes #88121
|
Is the comment in the second image quite correct? It says to match '2' and then begins an alternation, then match 5. I'd expect both in the alternation. |
Oh I see it's extracted the common prefix |
These could use the same language, though?
|
They could... it's recognizing 0-9 as being the same as ECMAScript \d, which is hardcoded to be "'0' through '9'" |
I think it would be a little easier to read in fairly everyday cases like this one. |
Also just curious why does it call out greedily in (just) some cases, given that's the default? |
It calls out for all loops (including ones with a min of 0 / max of 1, aka optional) whether they're greedy or lazy. |
df19b48
to
a5abf23
Compare
Fixes #88121
Before:
After: