Regular Expressions 101

Community Patterns

Password Validation

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?=(?:.*[a-z]){1})(?=(?:.*[A-Z]){3})(?=(?:.*[0-9]){1})(?=(?:.*[*#$%&!]){1})[A-Za-z0-9*#$%&!]{8,}$
/
mg

Description

Validates a password that has 1 lowercase character, 3 uppercase characters, 1 special character, 1 number and the total length of 8 characters. These are minimums of course, it can have more of each.

Submitted by anonymous - 3 years ago