function passValidate(){
var password=$password.val().trim()
if(password===""){
$mima.addClass('has-error')
$password.after('<lable class="help-block">密碼不能為空</lable>')
return false
}
//密碼為八位及以上並且字母數字特殊字符三項都包括
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
//密碼為七位及以上並且字母、數字、特殊字符三項中有兩項,強度是中等
var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g");
var enoughRegex = new RegExp("(?=.{6,}).*", "g");
if (false == enoughRegex.test(password)) {
} else if (strongRegex.test(password)) {
$password.after('<lable class="help-block"><span class="qiang">密碼強度強</span></lable>')
} else if (mediumRegex.test(password)) {
$password.after('<lable class="help-block" ><span class="zhong">密碼強度中</span></lable>')
} else {
$password.after('<lable class="help-block" ><span class="ruo">密碼強度弱</span></lable>')
}
return true
}