I'm looking to get a Regex for the following password strength requirements:
- Minimum 8 characters
- At least one upper case character
- At least one number (0-9)
- At least one special character (!,@,#,$,%,^,&,*,?,_,~,-,(,))
I need this to be able to be evaluated using the jquery.validate.password.js plugin.
Also, is it possible to provide the user feedback based on which of the criteria they're missing? For example, if the user is missing an upper case character, can I spit back a message that tells them? They provide an example showcasing how to pass in different validation messages:
var originalPasswordRating = $.validator.passwordRating;
$.validator.passwordRating = function(password, username) {
if (password.length < 100) {
return { rate: 0, messageKey: "too-short" };
}
};
$.validator.passwordRating.messages = $.extend(originalPasswordRating.messages, {
"too-short": "Your password must be longer than 100 chars"
});