JQuery authentication password validation in upper and lower case
$.validator.addMethod("validpassword", function(value, element) {
return this.optional(element) ||
/^.*(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[\d])(?=.*[\W]).*$/i.test(value);
}, "The password must contain a minimum of one lower case character," +
" one upper case character, one digit and one special character..");
The above regex does not distinguish between uppercase and lowercase letters. What's wrong?
+3
source to share