匹配特殊字符js 密码验证

if (!newValue) {
this.passwordError = "请输入密码";
} else if (newValue) {
/*不为空的时候在判断是否输入了不规范的东西*/
var pattern = new RegExp("[~'!@#¥$%^&*()-+_=:]");
if(pattern.test(newValue)){
this.passwordError = "请输入规范的密码"
}else {
this.passwordError = ""
}
}

猜你喜欢

转载自www.cnblogs.com/myfirstboke/p/9198716.html
今日推荐