I have password constraints that i would like to validate:
Currently my regex looks like this:
/^(?=.*\d+)(?=.*[a-zA-Z])[0-9a-zA-Z\_\$\#\%\&!\?\-\.]{6,}$/
Except for the special characters, all requirements are met. Can anybody explain to me what i am doing wrong with the special characters? As you can see, every character is escaped and grouped into a "allowed" character class. However, the test still fails.
thank you
/^(?=.{6})(?=.*[a-zA-Z])(?=.*\d)[\w$#%&!?.-]+$/
or
/^(?=.{6})(?=.*[a-z])(?=.*\d)[\w$#%&!?.-]+$/i
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With