1个式子检测密码强度

//校验密码级别
function checkPassWord(string) {
   
return string.replace(/^(?:(?=.{4})(?=.*([a-z])|.)(?=.*([A-Z])|.)(?=.*(\d)|.)(?=.*(\W)|.).*|.*)$/, "$1$2$3$4"
).length;
};
原文地址:https://www.cnblogs.com/Lewis/p/1379368.html