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
Digit matching behaving as intended? #401
Comments
If there are questions about my report: I'm following this issue. |
Note that the emoji compares between |
This explains a lot of above behavior—at least technically. On the other hand it scares me away from using regular expressions when writing code that should sanitize arbitrary input. Maybe an ascii-only mode would help? In my code I'm manually checking input now:
|
Thanks for the example, @NikolaiRuhe! It looks like custom character class ranges will need something a bit different than |
Note that in scalar semantics you should get your desired behavior. It's a reasonable interpretation to extend |
Reposted from the Swift forums: https://forums.swift.org/t/bad-digit-matching-bugreport-regarding-se-0354-regex-literals/57262/1
Problem: Some digit character groups match number-like grapheme clusters.
Above described behavior seems inconsistent and difficult to predict. Shouldn't [1-2] and [12] be identical? Should they match anything outside of ascii?
Note: 1️⃣ is U+0031 (ascii digit 1) U+FE0F (VARIATION SELECTOR-16) U+20E3 (COMBINING ENCLOSING KEYCAP)
Same is true for 1︎⃣: U+0031 (ascii digit 1) U+FE0E (VARIATION SELECTOR-15) U+20E3 (COMBINING ENCLOSING KEYCAP)
rdar://96898279
The text was updated successfully, but these errors were encountered: