Skip to content

Instantly share code, notes, and snippets.

@mrgcohen
Created March 27, 2014 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrgcohen/9806928 to your computer and use it in GitHub Desktop.
Save mrgcohen/9806928 to your computer and use it in GitHub Desktop.
strong passwords
// 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