Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
((?:19|[2-9][0-9])[0-9]{2})-(1[0-2]|0[1-9])-(3[01]|[12][0-9]|0[1-9])
/
gm

Description

Follows ISO 8601 standard (YYYY-MM-DD) $1 is year, $2 is month and $3 is day (for substitution)

Submitted by Danry Bir - 5 months ago