Skip to content

Instantly share code, notes, and snippets.

@detj
Last active December 23, 2015 11:09
Show Gist options
  • Save detj/6626241 to your computer and use it in GitHub Desktop.
Save detj/6626241 to your computer and use it in GitHub Desktop.
Password regex
// Should contain at least 1 number
// May contain upper character letters
// May contain only four special characters (#$@!)
var foo = /^(?:[0-9]+[a-zA-Z]|[a-zA-Z]+[0-9])[a-z0-9#$@!]*$/;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment