I am having a bit of a hard time with a password requirement regular expression for an ASP.NET project
Out requirements are the following
- Must be at least 8 characters
- Must have at least 3 of the 4 following:
- Have at least 1 UPPERCASE letter
- Have at least 1 lowercase letter
- Have at least 1 special character
- Have at least 1 number
The regular expression I am using is as follows (this is escaped and encoded for use in the web.config xml file:
passwordStrengthRegularExpression="^.*(?=.{8,})(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*()\?\+\,\-\.\/\:\:\;\<\=\>\[\]\\_\`\{\|\}\~\"\']).*$"
I cant figure out how to allow for one of the requirements to be optional.
the password Reaction7 should be sufficient, but it is rejected because it doesn't have a special character.
Anyone know what I can do to evaluate the 3 out of 4 requirements other than length?