var str = “111aaA”;
var reg=/^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\.])[0-9a-zA-Z!@#$%^&*,\.]{8,12}$/;
if(!reg.test(str)){
alert("您输入的密码格式不正确,请重新输入");
}
var str = “111aaA”;
var reg=/^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\.])[0-9a-zA-Z!@#$%^&*,\.]{8,12}$/;
if(!reg.test(str)){
alert("您输入的密码格式不正确,请重新输入");
}