Skip to content

WebKit bug with nested negated classes leads to incorrect matches #38

@slevithan

Description

@slevithan

As identified in 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 in Oniguruma-To-ES by converting e.g. [a[^a-z]] to (?:[a]|[^a-z]).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions