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

certain meta characters shouldn't be allowed in char ranges #219

Open
andruo11 opened this issue Jan 22, 2021 · 4 comments
Open

certain meta characters shouldn't be allowed in char ranges #219

andruo11 opened this issue Jan 22, 2021 · 4 comments

Comments

@andruo11
Copy link

When I parse the regex /[\w-z]/ it should throw an error, but instead parses as a regular character range with \w at the beginning. https://astexplorer.net/#/gist/124dd2c7d464e3cf68b532bf8dacae7f/01a86f60e792112367c9395cf1094b5806dcaab1 If I figure out how to fix it I'll let you know!

@andruo11 andruo11 changed the title meta characters shouldn't be allowed in char ranges certain meta characters shouldn't be allowed in char ranges Jan 22, 2021
@andruo11
Copy link
Author

andruo11 commented Jan 22, 2021

...and ditto for Unicode properties like /[\p{P}-z]/u

@DmitrySoshnikov
Copy link
Owner

Thanks for the report, yeah, the /[\w-z]/.test('-') should actually be parsed as a char class containing \w, - and z.

@andruo11
Copy link
Author

andruo11 commented Jan 25, 2021 via email

@brettz9
Copy link
Contributor

brettz9 commented Feb 25, 2021

Seems /[\p{P}-z]/u is at least throwing now even while /[\w-z]/ isn't.

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

3 participants