Skip to content

Fix repeated case-insensitive ASCII match #797

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

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

natecook1000
Copy link
Member

The optimized bytecode for matching repetition of a single character overlooks case insensitivity. This resolves that by falling back to use an ASCII bitset when doing a case-insensitive match of a cased character.

Fixes #785.

The optimized bytecode for matching repetition of a single character overlooks
case insensitivity. This resolves that by falling back to use an ASCII bitset
when doing a case-insensitive match of a cased character.

Fixes #785.
@natecook1000 natecook1000 requested a review from milseman January 6, 2025 21:04
@natecook1000
Copy link
Member Author

@swift-ci Please test

2 similar comments
@natecook1000
Copy link
Member Author

@swift-ci Please test

@natecook1000
Copy link
Member Author

@swift-ci Please test

Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Good fix. I'd like a few more test cases for this, which can come in a later PR if needed.

@natecook1000
Copy link
Member Author

@swift-ci Please test

@natecook1000 natecook1000 merged commit 4e10f38 into main Jan 8, 2025
2 checks passed
@natecook1000 natecook1000 deleted the case-insensitive-repetition branch January 8, 2025 00:19
natecook1000 added a commit that referenced this pull request Jan 14, 2025
The optimized bytecode for matching repetition of a single character overlooks
case insensitivity. This resolves that by falling back to use an ASCII bitset
when doing a case-insensitive match of a cased character.

Fixes #785.
natecook1000 added a commit that referenced this pull request Jan 14, 2025
The optimized bytecode for matching repetition of a single character overlooks
case insensitivity. This resolves that by falling back to use an ASCII bitset
when doing a case-insensitive match of a cased character.

Fixes #785.
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 this pull request may close these issues.

Case-insensitive regex with repetitions does not match uppercase characters correctly
3 participants