Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(?#at least one capital letter)(?=.*?[A-Z])(?#at leaste one lower case letter)(?=(.*[a-z]))(?#at leaste one number)(?=(.*[\d]))(?#at leaste one non letter or number)(?=(.*[^a-zA-Z0-9])).{6,}$
/
g

Description

password regex to match ASP.Net identity PasswordValidator var validatior = new PasswordValidator{RequiredLength = 6, RequireNonLetterOrDigit = true, RequireDigit = true, RequireLowercase = true, RequireUppercase = true };

Submitted by P. Zantinge - 7 years ago