Skip to content

Instantly share code, notes, and snippets.

@gusmantap
Created January 13, 2020 06:42
Show Gist options
  • Save gusmantap/cdde70ebf5edfc512eec1f84c0f97ea2 to your computer and use it in GitHub Desktop.
Save gusmantap/cdde70ebf5edfc512eec1f84c0f97ea2 to your computer and use it in GitHub Desktop.
/^(?=.*[A-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$@])(?!.*[iIoO])\S{6,12}$/
/^ // Start of the string.
(?=.*[A-z]) // must contains a characters (lowercase or uppercase characters).
(?=.*[a-z]) // must contains one lowercase characters.
(?=.*[A-Z]) // must contains one uppercase characters.
(?=.*[0-9]) // must contains one digit from 0-9.
(?=.*[$@]) // must contains one special symbols in this list $ and @.
(?!.*[iIoO]) // match any charcuter except i I o and O.
\S{6,12} // length at least 6 characters and a maximum of 12.
$/ // End of the string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment