Regex to validate passwords with characters restrictions
I need to validate a password with these rules:
6 to 20 characters
Must contain at least one digit;
Must contain at least one letter (case insensitive);
Can contain the following characters: !@#$%&*
The following expression matches all but the last requirement. What can I
do with the last one?
((?=.*\d)(?=.*[A-z]).{6,20})
No comments:
Post a Comment