Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CuongNgMan/97470410fb6fb892343d67e028f51db1 to your computer and use it in GitHub Desktop.
Save CuongNgMan/97470410fb6fb892343d67e028f51db1 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