Skip to content

Instantly share code, notes, and snippets.

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 skyfe79/4f636512e368931c698d2442cd0955ee to your computer and use it in GitHub Desktop.
Save skyfe79/4f636512e368931c698d2442cd0955ee to your computer and use it in GitHub Desktop.
Strong password Regular Expression - NestJS Course
  • Passwords will contain at least 1 upper case letter
  • Passwords will contain at least 1 lower case letter
  • Passwords will contain at least 1 number or special character
  • There is no length validation (min, max) in this regex!

Regular expression for JavaScript:

/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment