Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

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

Description

如果要指定可选的特殊字符,把| 后面的[^\w\s] 酌情替换

Submitted by devwolf__copy-by_天涯孤雁 - 3 years ago