Skip to content

Instantly share code, notes, and snippets.

View orafaribeiro's full-sized avatar

Rafael Ribeiro orafaribeiro

View GitHub Profile
@rezigned
rezigned / gist:2469020
Created April 23, 2012 05:50
Regex for password validation
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{7,20})
( # Start of group
(?=.*\d) # must contains one digit from 0-9
(?=.*[a-z]) # must contains one lowercase characters
(?=.*[A-Z]) # must contains one uppercase characters
(?=.*[@#$%]) # must contains one special symbols in the list "@#$%"
. # match anything with previous condition checking
{7,20} # length at least 7 characters and maximum of 20