RESOLVED FIXED292429
[Regex] Nested negated classes leads to incorrect matches
https://bugs.webkit.org/show_bug.cgi?id=292429
Summary [Regex] Nested negated classes leads to incorrect matches
Antoine Lethimonnier
Reported 2025-05-02 04:38:58 PDT
As identified in https://github.com/shikijs/shiki#1005, a WebKit bug results in nested negated character classes being treated as if they weren't negated. For example, in WebKit (as of Safari 18.4), /[a[^a-z]]/v incorrectly matches 'b' and incorrectly fails to match '!'. This can be worked around by converting e.g. [a[^a-z]] to (?:[a]|[^a-z]).
Attachments
Radar WebKit Bug Importer
Comment 1 2025-05-09 04:42:05 PDT
daniel_liu4
Comment 2 2025-05-21 16:02:29 PDT
EWS
Comment 3 2025-05-22 09:36:47 PDT
Committed 295277@main (c07d637bf020): <https://commits.webkit.org/295277@main> Reviewed commits have been landed. Closing PR #45731 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.