Skip to content

Instantly share code, notes, and snippets.

@Falence
Forked from arielweinberger/strong-password-regex.md
Created November 10, 2021 10:25
Show Gist options
  • Select an option

  • Save Falence/81883eef0220bf803202ae5c1e0e061e to your computer and use it in GitHub Desktop.

Select an option

Save Falence/81883eef0220bf803202ae5c1e0e061e 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