Created
March 27, 2014 12:55
-
-
Save mrgcohen/9806928 to your computer and use it in GitHub Desktop.
strong passwords
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// strong password validation | |
jQuery.validator.addMethod("strongPassword", function(value, element) { | |
return value.match(/[a-z]/) | |
&& value.match(/[A-Z]/) | |
&& value.match(/[1-9]/) | |
&& value.match(/[^0-9a-zA-Z]/) | |
&& value.length >= 8; | |
}, "Password must be 8 characters long, contain at least one lowercase character (a-z), one uppercase character (A-Z), at least one digit (0-9), and at least one special character."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment