Regular Expressions 101

Community Patterns

Password regex

0

Regular Expression
PCRE (PHP <7.3)

/
^(?=.*[A-Z])(?=.*[!@#$&*])(?=.*[0-9])(?=.*[a-z]).{8,16}$
/

Description

Password pattern looking for strength. Between 8 and 16 characters. At least:

1 UpperCase. 1 LowerCase. 1 SpecialCase. 1 Number

Submitted by morethansimplycode.blogspot.com.es - 9 years ago