Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?=^.{7,}$)(?=.*\d)(?=.*[A-Za-z])(?=.*[@'#.$;%^&+=!""()*,-\/:<>?]).*$
/

Description

Minimum 7 chars long

Must have at least one char

Must have at least one number

Must have at least one special char i.e. @'#.$;%^&+=!""(),-/:<>?*

Submitted by Piyush - 9 years ago