Regular Expressions 101

Community Patterns

1...34567...735

Validate Birth Date (d/m/Y)

6

Regular Expression
PCRE (PHP <7.3)

/
^(0[1-9]|[1-2][0-9]|3[0-1])\/(0[1-9]|1[0-2])\/(\d{4})$
/
gm

Description

From 1970 to 2015 Replace: (\d{4})$ for (19[7-9]\d|20[0-1][0-5])$

Submitted by Valdeir Santana - 8 years ago