📅  最后修改于: 2022-03-11 15:02:27.850000             🧑  作者: Mango
// 1 line password validation for
// Uppercase, Lowercase, Number, Special Character
$("#submit_id").click(function() {
var pattern = /^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%&]).*$/;
if(!pattern.test($("#pswd").val())){
alert("INVALID PASSWORD");
}else{
alert("You have a strong PASSWORD");
}
});