验证密码强度的Regex我的密码强度标准如下:8个字符长度上装2个字母1个特殊字符(!@#$&*)2个数字(0-9)3封小写字母有人能给我同样的补偿吗。所有条件必须通过密码满足。
3 回答
慕的地6264312
TA贡献1817条经验 获得超6个赞
^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8}$
^ Start anchor (?=.*[A-Z].*[A-Z]) Ensure string has two uppercase letters. (?=.*[!@#$&*]) Ensure string has one special case letter. (?=.*[0-9].*[0-9]) Ensure string has two digits. (?=.*[a-z].*[a-z].*[a-z]) Ensure string has three lowercase letters. .{8} Ensure string is of length 8. $ End anchor.
幕布斯7119047
TA贡献1794条经验 获得超8个赞
(?=.{8,})(?=.*\p{Lu}.*\p{Lu})(?=.*[!@#$&*])(?=.*[0-9])(?=.*\p{Ll}.*\p{Ll})
\p
\p{Lu}
[A-Z]
\p{Ll}
[a-z]
.
- 3 回答
- 0 关注
- 792 浏览
添加回答
举报
0/150
提交
取消