6

求密码校验正则

 2 years ago
source link: https://www.oschina.net/question/3943503_2323698
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

求密码校验正则

BankSnow 发布于 昨天 08:44
阅读 124

客户提了一个密码校验的需求,要求输入的密码中不能包含连续的数字,密码是可以包含数字,大小写字母,特殊符号的。现在卡在了校验不能包含连续的数字。

举例,符合要求:a135bd20,不符合要求:10abd346.

规则就是,如果遇到了数字0,0的后面不能是1,即01形式;遇到了1,不能是10和12形式,以此类推,到9就不能是98形式,可以是90.

求大佬帮忙指教一下,js的版本。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK