Skip to content

<regex>: Backslashes in character classes are sometimes not matched in basic regular expressions #5379

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

Open
muellerj2 opened this issue Mar 29, 2025 · 0 comments
Labels
bug Something isn't working regex meow is a substring of homeowner

Comments

@muellerj2
Copy link
Contributor

The basic regular expressions [\(], [\)], [\{] and [\}] do not match the backslash, even though all of them should. The lexer internally recognizes and handles these "escaped" parentheses and braces as the opening and closing parentheses of capture groups or braces of quantifiers, even though there are no capture groups or quantifiers within character classes.

Noticed while writing test coverage for closely related #5244.

@StephanTLavavej StephanTLavavej added bug Something isn't working regex meow is a substring of homeowner labels Mar 31, 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 regex meow is a substring of homeowner
Projects
None yet
Development

No branches or pull requests

2 participants