Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save faultyagatha/0914033a096880d06427a89d86b33b31 to your computer and use it in GitHub Desktop.
Save faultyagatha/0914033a096880d06427a89d86b33b31 to your computer and use it in GitHub Desktop.

Revisions

  1. @arielweinberger arielweinberger revised this gist Jun 4, 2019. 1 changed file with 6 additions and 9 deletions.
    15 changes: 6 additions & 9 deletions strong-password-regex.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,9 @@
    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
    * 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:
    ```
    (?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$
    ```

    Credit goes to @ravibharathii
    /((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/
    ```
  2. @arielweinberger arielweinberger created this gist Jun 4, 2019.
    12 changes: 12 additions & 0 deletions strong-password-regex.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    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

    Regular expression for JavaScript:
    ```
    (?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$
    ```

    Credit goes to @ravibharathii