Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,}$
/
gm

Description

Checks that a password has a minimum of 8 characters, at least 1 uppercase letter, 1 lowercase letter, and 1 number.

Submitted by letrongtanbs - 2 years ago