Skip to content

Not guarding against preceding \0 when interpolating into a character class #31

Open
@slevithan

Description

@slevithan

RegExp.make`[\0${0}]` returns /[\00]/, which is equivalent to /\0/. The same problem occurs with other interpolated digits.

The correct output should allow it to match a literal '0', similar to how RegExp.make correctly guards against a preceding \0 when interpolating outside of a character class.

I have a working implementation of this in regex, which returns /[\u{0}0]/v.

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