Skip to content

Instantly share code, notes, and snippets.

@imjakechapman
Last active April 21, 2020 22:57
Show Gist options
  • Save imjakechapman/d2c95bae144aa1ba85a2b167e9499bea to your computer and use it in GitHub Desktop.
Save imjakechapman/d2c95bae144aa1ba85a2b167e9499bea to your computer and use it in GitHub Desktop.
Password Complexity Regex's
// 8 characters minium. 1 uppercase character, 1 lowercase character, 1 number, 1 special character
const strongRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/;
// 6 characters minium. 1 uppercase character, 1 lowercase character, 1 number
const mediumRegex = /^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment