Bug 292429
| Summary: | [Regex] Nested negated classes leads to incorrect matches | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Antoine Lethimonnier <ames_cedre_8b> |
| Component: | JavaScriptCore | Assignee: | daniel_liu4 |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | keith_miller, msaboff, steves_list, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 18 | ||
| Hardware: | All | ||
| OS: | All | ||
Antoine Lethimonnier
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/151000852>
daniel_liu4
Pull request: https://github.com/WebKit/WebKit/pull/45731
EWS
Committed 295277@main (c07d637bf020): <https://commits.webkit.org/295277@main>
Reviewed commits have been landed. Closing PR #45731 and removing active labels.