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