php檢測郵箱密碼
$pattern = "/^[0-9a-zA-Z_-]+(\.[0-9a-zA-Z_-]+)*@[a-zA-Z0-9_-]+(\.{1}[a-zA-Z0-9_-]+)*\.{1}[a-zA-Z]{2,4}$/i";
if(!preg_match($pattern,$email)){
echo "郵箱不符合規則";
}
//$patternpwd = "/[A-Za-z]{6,15}/";
//$patternpwdnum = "/[0-9]{6,15}/";
$pa="/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/";//字母數字不少於6位
if(!preg_match($pa,$pwd)){
echo "密碼不符合規則";
}