I'm trying to create a regex that will meet the following requirements for a password.
- Must have at least 1 uppercase
- Must have at least 1 lowercase
- Must contain a number OR a symbol - FAILS
Must be between 8 to 16 characters long
^(?=.*\d|[!@#\$%\^&])(?=.*[a-z])(?=.*[A-Z]).{8,16}$
I've got it working, well almost, except the OR part. It verifies for instance Tester01 and Tester0% but it wont verify Tester%$ or anything with two symbols, just in case the user doesn't put in a number. I've also tried putting brackets around the \d thinking I had to separate the digits from the symbols but that didn't work.