Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

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

Description

(?=.[0-9]) =must contain numbers, (?=.[!@#$%^&]) =must contain special. symbols , (?=.[a-z]) =must contain Latin letters, (?=.[A-Z]) =must contain capital Latin letters, [0-9a-zA-Z!@#$%^&] =can contain numbers, Latin letters, special. symbols {6,} =must contain 6 and more chars,

Submitted by anonymous - 3 years ago