KEMBAR78
`<regex>`: Restrict control letters in escapes to alphabetic ASCII characters by muellerj2 · Pull Request #5524 · microsoft/STL · GitHub
Skip to content

Conversation

muellerj2
Copy link
Contributor

Towards #995. ECMAScript 15.10.1 defines the production ControlLetter such that only ASCII alphabetic characters are allowed. Such restricted character sets are often extended to corresponding POSIX character classes (to include Unicode characters) by Boost.Regex or <regex> implementations. But such an extension doesn't make much sense in this specific case, because these \c + letter escapes are supposed to emulate what pressing Ctrl + ASCII character does in the terminal. (It would actually make more sense to support "\c[" and similar, but the ECMAScript standard doesn't say so.)

Alternative: If non-ASCII characters should remain supported, we could query the bitmask of the character class "alpha" from the traits class.

@muellerj2 muellerj2 requested a review from a team as a code owner May 18, 2025 15:22
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews May 18, 2025
@StephanTLavavej StephanTLavavej added bug Something isn't working regex meow is a substring of homeowner labels May 18, 2025
@StephanTLavavej StephanTLavavej self-assigned this May 18, 2025
@StephanTLavavej
Copy link
Member

Thanks! 😻 I pushed minor changes, please meow if I was confused.

@StephanTLavavej StephanTLavavej removed their assignment May 20, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews May 20, 2025
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews May 22, 2025
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit a98a750 into microsoft:main May 22, 2025
40 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews May 22, 2025
@StephanTLavavej
Copy link
Member

There is no escape for regex bugs! 😹 🤪 🤣

@muellerj2 muellerj2 deleted the regex-restrict-control-letters branch May 31, 2025 21:45
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

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants