I'm trying to build a regex to validate passwords in my application.
This is PCRE (php).
My regex so far looks like this
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*\(\)_\+\-\=\[\]\{\}\|'])(?=.*[^\\\/])(?=.{8,20})/
And my criteria are the following
minimum length: 8
maximum length: 20
require special character: true
require uppercase: true
require lowercase: true
require number: true
special character set: !@#$%^&*()_+-=[]{}|'
excluded character set: \/
Everything works but the excluded character set. The idea is the password must not contain any of the characters specified in that list.
Thanks for the help