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

<regex>: Make negated character classes not match characters not included in the negated character class #5214

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

muellerj2
Copy link
Contributor

@muellerj2 muellerj2 commented Dec 30, 2024

Partially addresses #992 again. While there is no easy way to make negated character class escapes (in square-bracket character classes) match members of the class, we can at least make sure that such escapes don't match non-members.

Drive-by changes:

  • Correct the limit check (although I think the correction has no practical consequences).
  • Change _Builder::_Add_named_class and _Builder::_Add_elts to use the char_class_type of the traits class instead of _Regex_traits_base::char_class_type when adding a character class.
  • Remove the default argument from _Builder::_Add_named_class.

@muellerj2 muellerj2 requested a review from a team as a code owner December 30, 2024 14:36
@muellerj2 muellerj2 force-pushed the regex-make-negated-character-class-escapes-not-match-non-members branch from fcd90ca to 45e47b4 Compare January 1, 2025 12:51
@StephanTLavavej StephanTLavavej added the bug Something isn't working label Jan 4, 2025
@StephanTLavavej StephanTLavavej self-assigned this Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Initial Review
Development

Successfully merging this pull request may close these issues.

2 participants