- var newpwd = $("#newpassword").val();
- //var pattern = "([A-Za-z]|[0-9]|-|_){4,16}";
- //var reg = new RegExp(pattern,"g");
- var reg = /^(?=.*[a-zA-Z])(?=.*d)(?=.*[~!@#$%^&*()_+`-={}:";'<>?,./]).{4,16}$/;
- var flag = reg.test(newpwd);
- if(flag == false){
- alert("新密码必须由 4-16位字母、数字、特殊符号线组成.");
- return false;
- }