Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(?=.*[a-zA-Z])(?=.*\d)[a-zA-Z0-9~!@#$%^&*()_+}{\][";:;'?\/>;.<;,]{8,64}$
/

Description

Allows for a wide range of special characters.

If you want it to have no upper bound, remove the 64 (but leave the 8,.

Submitted by Peter Speden - 10 years ago