The form of the password can be set according to the development requirements, below are several examples of matching passwords:
Regular Expression ^[a-za-z]\w{5,17}$
Matches start with a letter, length between 6~18, only characters, numbers, and underscores
does not match
Regular expression ^ (? =.*\d) (? =.*[a-z]) (? =.*[a-z]) (?!. *\s). {4,8}$
Matching 1agda*$# | 1agda*$# | 1agda*$#
Do not match wyrn%@*&$# f | mbndkfh782 | bnfhjdhfjd&*)%#$)
Regular expression [^a-za-z0-9]
Matching!@#$ | %^&* | ' ><?., '
Mismatched ABC123ABC | ABC123ABC | Abc0132abc
Regular Expression password= "(\{.+\}[0-9a-za-z]+[=]*|[ 0-9a-za-z]+) "
Matching!@#$ | %^&* | ' ><?., '
Mismatched ABC123ABC | ABC123ABC | Abc0132abc
Regular expression (?-i) (? =^.{ 8,}$) ((?!. *\s) (? =.*[a-z]) (? =.*[a-z])) (? = (1) (? =.*\d) |. *[^A-ZA-Z0-9]) ^.*$
Match a3dabed. | P@ssword1 | ab_1bbbb | mypassw0rd!
Mismatched password | password12 | Password__12 | P@ssw0rd
The above is a small series to introduce the regular expression matching user password related content, I hope to help you!