0

I need password that includes special characters that are with OWASP standard https://www.owasp.org/index.php/Password_special_characters

pattern="^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$"

Currently my password conditions are:

  • Length of at least 8 characters long
  • Contain at least 1 lowercase letter [az]
  • Contain at least 1 capital letter [AZ],
  • Contain at least 1 number [0-9]
  • Contain at least 1 special character (currently only #?! @ $% ^ & * -)

When I try to add more special characters (all 33 according to OWASP) I always get some problems (bad verification or not working)

Ivan Vulović
  • 2,147
  • 6
  • 27
  • 43
  • Just learn to escape special regex metacharacters in your patterns. Hint: always keep `-` at the end of the character class. – Wiktor Stribiżew Nov 20 '17 at 09:56
  • @WiktorStribiżew You marked as duplicated, can you point on duplicated link. Cause I am trying and trying to escape it and I always get some errors. I wasted whole day on this. :( I already tried https://stackoverflow.com/questions/3115150/how-to-escape-regular-expression-special-characters-using-javascript and https://stackoverflow.com/questions/399078/what-special-characters-must-be-escaped-in-regular-expressions ... without success – Ivan Vulović Nov 20 '17 at 10:04
  • Show your [regex fiddle](http://regex101.com). – Wiktor Stribiżew Nov 20 '17 at 10:07
  • @IvanVulović You did not provide a [mcve] of your problem in the question. What code did you try? What result did you expect? What error did you see? – Tom Lord Nov 20 '17 at 10:17

0 Answers0