前言
最开始从网上随便找的一个正则,然后没仔细看,测试发现空格和汉字都会匹配,仔细看了下正则发现了\W
,所以就针对这个正则进行了修改;
/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_]+$)(?![a-z0-9]+$)(?![a-z\W_]+$)(?![0-9\W_]+$)[a-zA-Z0-9\W_]{8,16}$/
内容
正则
^(?![a-zA-Z]+$)(?![A-Z\d]+$)(?![A-Z_!@#$%^&*`~()-+=]+$)(?![a-z\d]+$)(?![a-z_!@#$%^&*`~()-+=]+$)(?![\d_!@#$%^&*`~()-+=]+$)[a-zA-Z\d_!@#$%^&*`~()-+=]{8,16}$
学无止境,谦卑而行.