Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+{}|:"<>?[\];',.\/~-]).{12,30}$
/
gm

Description

  1. 長度在12到30個字符之間;
  2. 至少包含一個小寫字母;
  3. 至少包含一個大寫字母;
  4. 至少包含一個數字;
  5. 至少包含一個特殊符號(如!@#$%^&*()_+{}|:"<>?[];',./`~-)。
Submitted by SCL - 2 years ago