Regular expression matching user password

Time:2019-12-27

The password form can be set according to the development requirements. Here are some examples of matching passwords:

Regular expression ^ [a-za-z] \ w {5,17}$

The match starts with a letter and is between 6 and 18 in length. It can only contain characters, numbers and underscores

Mismatch

Regular expression ^ (? =. * \ d) (? =. * [A-Z]) (? =. * [A-Z]) (?!. * \ s). {4,8}$

Match 1agda * $#| 1agda * $#| 1agda*$#

Do not match wyrn% @ * & $ා f | mbndkfh782 | bnfhjdhfjd & *)% # $)

Regular expression [^ a-za-z0-9]

Match! @ # $|% ^ & * | ‘<“

Do not match abc123abc | abc123abc | abc0132abc

Regular expression password = “(\ {. + \} [0-9a-zA-Z] + [=] * | [0-9a-zA-Z] +)”

Match! @ # $|% ^ & * | ‘<“

Do not match abc123abc | abc123abc | abc0132abc

Regular expression (? = ^. {8,} $) (?!. * \ s) (? =. * [A-Z]) (? = [A-Z]) (? = (1) (? =. * \ d) |. * [^ a-za-z0-9]) ^*$

Match a3dabed. | P @ ssword1 | ab | 1bbbbb | mypassw0rd!

Do not match password | password12 | password | 12 | P @ ssw0rd

The above is the content of regular expression matching user password introduced by Xiaobian. I hope it can help you!