Regular expression

3
I am searching for a regular expression that can be used to get strong passwords. In this regular expression I would like the following specifications: Minimum length of 8 characters. Minimum 1 special character like a % or @. The other characters can be all alphanumeric. Does anyone know such a regular expression.
asked
1 answers
4

regular expressions for strong password in aspnet

Here is a regex if you want this criteria:
Passwords will contain at least (1) upper case letter
Passwords will contain at least (1) lower case letter
Passwords will contain at least (1) number or special character
Passwords will contain at least (8) characters in length
Password maximum length should not be arbitrarily limited

(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$

And for a version without a check for lower/upper case I made this one out of it:

(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n]).*$

Also you can always check your regexes at Regex Tester.

answered