密码正则

if (!preg_match('/^(d|[a-zA-Z]|[!@#$%^&*.]){6,18}$/', $password)){
throw new Exception($errorCode ? $errorCode: '10201005');
}

原文地址:https://www.cnblogs.com/brady-wang/p/5669822.html