I'm new to jquery and trying to use the validate a password of pretty basic complexity.
The password must be at least 7 characters, have at least 1 upper case, have at least 1 lower case, and at least 1 number OR special character.
This question is very similar to this answer I found, however I'm having trouble adding the "digit OR special char" part.
I think it's a regex I'm just not getting. My modification to that answer looks like this:
$.validator.addMethod("pwcheck", function(value) {
return /^[A-Za-z0-9\d=!\-@._*]*$/.test(value) // consists of only these
&& /[a-z]/.test(value) // has a lowercase letter
&& /[A-Z]/.test(value) //has an uppercase letter
&& (/\d/.test(value) || /~!@#$%^&*_-+=[]\{}|;':",.<> /.test(value)
// has a digit or special char
});