Skip to content
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

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

Open
slevithan opened this issue Jun 2, 2024 · 0 comments

Comments

@slevithan
Copy link

slevithan commented Jun 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant