I want a regular expression to check that:
A password contains at least eight characters, including at least one number and includes both lower and uppercase letter
Import the JavaScript file jquery.validate.min.js
.
You can use this method:
$.validator.addMethod("pwcheck", function (value) {
return /[\@\#\$\%\^\&\*\(\)\_\+\!]/.test(value) && /[a-z]/.test(value) && /[0-9]/.test(value) && /[A-Z]/.test(value)
});