Skip to content

Instantly share code, notes, and snippets.

@rambuvn
Created May 21, 2012 09:12
Show Gist options
  • Save rambuvn/2761421 to your computer and use it in GitHub Desktop.
Save rambuvn/2761421 to your computer and use it in GitHub Desktop.
Checking password complexity This regular expression will tests if the input consists of 6 or more letters, digits, underscores and hyphens. The input must contain at least one upper case letter, one lower case letter and one digit.
$password_regular = 'A(?=[-_a-zA-Z0-9]*?[A-Z])(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])[-_a-zA-Z0-9]{6,}z'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment