javascript regex for special characters
I'm trying to create a validation for a password field which allows only
the a-zA-Z0-9 characters and .!@#$%^&*()_+-=
I can't seem to get the hang of it.
What's the difference when using regex = /a-zA-Z0-9/g and regex =
/[a-zA-Z0-9]/ and which chars from .!@#$%^&*()_+-= are needed to be
escaped?
What I've tried up to now is:
var regex = /a-zA-Z0-9!@#\$%\^\&*\)\(+=._-/g
but with no success
No comments:
Post a Comment