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

Unnecessary escape character - in Regex #805

Closed
EasyAsABC123 opened this issue Mar 1, 2017 · 1 comment

Comments

@EasyAsABC123
Copy link

commented Mar 1, 2017

the code it is failing on is:

return /^[a-zA-Z0-9 \.#]+$/.test(input)
@feross

This comment has been minimized.

Copy link
Member

commented Mar 1, 2017

This is working as intended. It's failing because you're escaping . inside of a character set. Try:

return /^[a-zA-Z0-9 .#]+$/.test(input)

@feross feross closed this Mar 1, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.