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

invalid range error when using dasherize() #46

Open
dwayne-mss opened this issue Jun 22, 2020 · 0 comments
Open

invalid range error when using dasherize() #46

dwayne-mss opened this issue Jun 22, 2020 · 0 comments

Comments

@dwayne-mss
Copy link

dwayne-mss commented Jun 22, 2020

While testing an application built with Elm, I came across an error triggered by using the dasherize() method. It seems that the RegEx [_-\\s]+ used in the method is not a legitimate expression in many languages and javascript parsers written in those languages throw an exception when executing this code because the - is seen as part of an invalid range terminated by a character group.

I'm not sure of all of the use cases, but ECMAScript seems to interpret the expression as a range without an end. But it also seems that the desired behavior (as I see it) could also be achieved using the RegEx
[_\\s-]+ or even
[_\-\\s]+" so that the "-" is not interpreted as a range. But it might be the case that an open ended range is required for some cases, though a range that begins with "_" seems like it would match nearly everything.

I'm not certain, so opening an issue.

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