| Description |
User can specify n numbers of digits, upper case character and special character.
In this example, we will use two special characters, digits and upper case in the password.
Explanation:
(?=^.{12,25}$) -- password length range from 12 to 25
(?=(?:.*?[!@#$%*()_+^&}{:;?.]){2}) -- at least 2 special characters (!@#$%*()_+^&}{:;?.})
(?=(?:.*?\d){2}) -- at least 2 digits
(?=.*[a-z]) -- characters a-z
(?=.{2,}[A-Z]) -- at least 2 upper case characters
|