Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(^$|[1][9][6-9]\d|[2][0][0]\d|[2][0][1][0-7]|[1][9][6-9]\d[\/\-]([0][0-9])|([1][0-2])|[2][0][0-2]\d[\-]([0][0-9])|([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])))$
/
gm

Description

1999 1999-02 1999/02 1999-02-08

Submitted by anonymous - 4 years ago