It doesn't work properly, I get the Password doesn't match! for each password I write with letters, numbers and Uppercase Letters
var reg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).*$"/;
var pass = document.getElementById("password").value;
if (pass == "") {
alert("Enter the user password");
document.getElementById("password").focus();
return false;
}
if (pass.length < 8) {
alert("Password too short, at least 8 characters");
document.getElementById("password").focus();
return false;
}
var pasw = pass.match(reg);
if (pasw) {
alert("Password is valid");
} else {
alert("Password doesn't match!");
return false;
}