Skip to content

Instantly share code, notes, and snippets.

@ravibharathii
Created October 29, 2012 18:03
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save ravibharathii/3975295 to your computer and use it in GitHub Desktop.
Save ravibharathii/3975295 to your computer and use it in GitHub Desktop.
A Regular Expression for a Strong Password
Description of this regular expression is as below:
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
Passwords will contain at least 8 characters in length
Password maximum length should not be arbitrarily limited
(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$
@chucklu
Copy link

chucklu commented Nov 11, 2021

The password length should have maximum limited Long password denial of service
Recommended special characters: The same list as string (between double quotes): " !"#$%&'()*+,-./:;<=>?@[]^_`{|}~"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment