Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^((0?[1-9]|[12][0-9]|3[01])(Jan|JAN|Mar|MAR|May|MAY|Jul|JUL|Aug|AUG|Oct|OCT|Dec|DEC)([0-9][0-9][0-9][0-9])|(0?[1-9]|[12][0-9]|30)(Apr|APR|Jun|JUN|Sep|SEP|Nov|NOV)([0-9][0-9][0-9][0-9])|(0?[1-9]|1[0-9]|2[0-8])(Feb|FEB)([0-9][0-9][0-9][0-9])|(29)(Feb|FEB)([0-9][0-9])([02468][048]|[13579][26]))$
/
gm

Description

Format of 29Feb2020 or 29FEB2020 with leap year check

Submitted by anonymous - 7 years ago