Regex for Password Must be contain at least 8 characters, least 1 number and both lower and uppercase letters and special characters
- by user2442653
I want a regular expression to check that
Password Must be contain at least 8 characters, including at least 1 number and
includes both lower and uppercase letters and special characters (e.g., #, ?, !)
Cannot be your old password or contain your username, "password", or "websitename"
And here is my validation expression which is for 8 characters including 1 uppercase letter, 1 lowercase letter, 1 number or special character.
(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$"
How I can write it for password must be 8 characters including 1 uppercase letter, 1 special character and alphanumeric characters?