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

Fix handling of case-sensitive set loops in RegexPrefixAnalyzer.FindPrefixes #101608

Merged
merged 2 commits into from Apr 29, 2024

Conversation

stephentoub
Copy link
Member

For an expression like [Aa]{2}, we were generating the strings "AA" and "aa" but not "Aa" or "aA".

This code isn't exercised yet, as we're currently only using FindPrefixes for case-insensitive, but I'm trying to enable it for case-sensitive as well, and hit this. I'm not adding new tests here as plenty of existing tests catch it once it's enabled.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

@danmoseley
Copy link
Member

danmoseley commented Apr 26, 2024

Perhaps I'm not following, but wouldn't we normally avoid making a change that isn't exercised, and instead include it with the change that uses it?

@stephentoub
Copy link
Member Author

Perhaps I'm not following, but wouldn't we normally avoid making a change that isn't exercised, and instead include it with the change that uses it?

The code is already there. It should be correct.

…refixes

For an expression like `[Aa]{2}`, we were generating the strings "AA" and "aa" but not "Aa" or "aA".

This code isn't exercised yet, as we're currently only using FindPrefixes for case-insensitive, but I'm trying to enable it for case-sensitive as well, and hit this. I'm not adding new tests here as plenty of existing tests catch it once it's enabled.
@stephentoub stephentoub merged commit 73a428d into dotnet:main Apr 29, 2024
79 of 84 checks passed
@stephentoub stephentoub deleted the fixsetloops branch April 29, 2024 17:55
matouskozak pushed a commit to matouskozak/runtime that referenced this pull request Apr 30, 2024
…refixes (dotnet#101608)

* Fix handling of case-sensitive set loops in RegexPrefixAnalyzer.FindPrefixes

For an expression like `[Aa]{2}`, we were generating the strings "AA" and "aa" but not "Aa" or "aA".

This code isn't exercised yet, as we're currently only using FindPrefixes for case-insensitive, but I'm trying to enable it for case-sensitive as well, and hit this. I'm not adding new tests here as plenty of existing tests catch it once it's enabled.

* Also exit early as soon as we can detect too many possible prefixes
michaelgsharp pushed a commit to michaelgsharp/runtime that referenced this pull request May 9, 2024
…refixes (dotnet#101608)

* Fix handling of case-sensitive set loops in RegexPrefixAnalyzer.FindPrefixes

For an expression like `[Aa]{2}`, we were generating the strings "AA" and "aa" but not "Aa" or "aA".

This code isn't exercised yet, as we're currently only using FindPrefixes for case-insensitive, but I'm trying to enable it for case-sensitive as well, and hit this. I'm not adding new tests here as plenty of existing tests catch it once it's enabled.

* Also exit early as soon as we can detect too many possible prefixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants