/** * Created by mrava on 2017-5-11. */ function pwdTest(value) { if (value.length < 8 || value.length>16) { return false; } var nu=0; if (/[0-9a-zA-Z!@#\$%\^&\*\(\)\{\}\|:\<\>~_\+"\[\]\\;,\./`\-=]/.test(value)){ if(/[0-9]/.test(value)) nu++ if(/[a-zA-Z]/.test(value)) nu++ if (/[!@#\$%\^&\*\(\)\{\}\|:\<\>~_\+"\[\]\\;,\./`\-=]/.test(value)) nu++ if(nu==3) return true else return false }else return false; }