Regular Expressions 101

Community Patterns

There does not seem to be anything here

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[\!-\/\:-\@\[-\`\{-\~])(?:.{8})$
/
gm

Description

  • 8 characters long
  • Must include capital letters
  • Must include small letters
  • Must include numbers
  • Must include special characters
  • NOTE: Can also use [[:punct:]] for special characters but it may not be supported by your regex engine.
Submitted by anonymous - 4 years ago (Last modified 4 years ago)