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

Case insensitivity behavior of character class ranges differs from PCRE #395

Closed
hamishknight opened this issue May 10, 2022 · 0 comments · Fixed by #570
Closed

Case insensitivity behavior of character class ranges differs from PCRE #395

hamishknight opened this issue May 10, 2022 · 0 comments · Fixed by #570
Assignees

Comments

@hamishknight
Copy link
Contributor

hamishknight commented May 10, 2022

PCRE allows (?i)[B-a], which matches e.g B, [, b, and A. However, we crash at runtime.

rdar://96898279

natecook1000 added a commit to natecook1000/swift-experimental-string-processing that referenced this issue May 19, 2022
The prior implementation didn't make a lot of sense, and couldn't
handle cases like `/(?i)[X-c]/`. This new approach uses simple case
matching to test if the character is within the range, then tests if
the uppercase or lowercase mappings are within the range.

Fixes apple#395
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants