0

I have to write javascript regex for password field to only allow some special char and space with alphanumeric, I don't want "#" to allow but below regex is allowing the # as well.

"(?=.*[\s!@\$%\^\(\)-_=])(?=.*[a-z])(?=.*[A-Z]).{14,20}"
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
  • In your regex you have `.*` which allow every characters – thibsc Apr 23 '20 at 15:01
  • I have tried changing the regex but not able to make could you help in writing this for me. my requirement is to create password validation allowing alphanumeric and "! @ $ % ^ ( ) - _ = " only these spceial character and space ,, will it possible – Prashant Patel Apr 23 '20 at 15:06
  • The above suggestion didn't work but issue is solved now – Prashant Patel May 10 '20 at 14:00

0 Answers0