Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
((?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!"#$%&'()*+,-.:;<=>?@[\]^_`{|}~]).*).{8,10}
/
g

Description

I verify if a string contains from 8 to 10 char and at least one of the following: Upper case char, lower case char, number, special character

Submitted by exSnake - 9 years ago