<regex>
: Make wregex
properly match the combination of \w
and another named character class
#5438
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #5243 by repurposing another unused flag bit when the combined character class of "w" and another named class has to be represented.
After this PR, a different value is assigned to the
_Classes
field in the NFA node when we run into the buggy scenario, but the code takes care that the same value is assigned in all other cases. This means that the old matcher may only match different characters in the buggy scenario for code points >= 0x100: It will now match the members of the other named character classes rather than the members of the character class "w".