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>: Allow initial ] to start character ranges in POSIX regular expressions #5364

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

muellerj2
Copy link
Contributor

Fixes a regex miscompilation noticed in #5165.

The POSIX standard says that the right bracket ] is not special at the beginning of a bracketed character class (https://pubs.opengroup.org/onlinepubs/009696699/basedefs/xbd_chap09.html#tag_09_03_05). This means that an initial ] behaves like any other character, so it may also be the start of a character range.

@muellerj2 muellerj2 requested a review from a team as a code owner March 25, 2025 22:13
@StephanTLavavej StephanTLavavej added bug Something isn't working regex meow is a substring of homeowner labels Mar 25, 2025
@StephanTLavavej StephanTLavavej self-assigned this Mar 25, 2025
@StephanTLavavej StephanTLavavej changed the title <regex>: Allow initial ] to start character ranges in POSIX regular expressions <regex>: Allow initial ] to start character ranges in POSIX regular expressions Mar 25, 2025
@StephanTLavavej
Copy link
Member

Thanks! 😻 I pushed changes to significantly expand the test coverage.

@StephanTLavavej StephanTLavavej removed their assignment Apr 2, 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
Status: Ready To Merge
Development

Successfully merging this pull request may close these issues.

2 participants