Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(?=.*[a-z])(?=.*[A-Z])(^[a-zA-Z])(?=.*\d)[a-zA-Z0-9]{7,}$
/
g

Description

<h1> Password Validation </h1>
  • Must Begin with a letter
  • Must be at least 8 characters long
  • Must contain at least one upper case character
  • Must contain at least one lower case character
  • Must contain at least one numeric character (int)
  • No special characters allowed (including spaces)
Submitted by anonymous - 6 years ago