常见密码验证规则
- 至少八个字符,至少一个字母和一个数字:
"^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$"
- 至少八个字符,至少一个字母,一个数字和一个特殊字符:
"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$"
- 最少八个字符,至少一个大写字母,一个小写字母和一个数字:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$"
- 至少八个字符,至少一个大写字母,一个小写字母,一个数字和一个特殊字符:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,}"