Regular Expressions 101

Community Patterns

Search for a date (Y/m/d or d/m/Y)

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(?'YMDyear'[\d]{4})?\/(?'YMDmonth'[\d]{2})\/(?'YMDday'[\d]{2})|(?'DMYday'[\d]{2})\/(?'DMYmonth'[\d]{2})\/(?'DMYyear'[\d]{4})
/
sigm

Description

Search for a date in a text.

Submitted by globdug - 3 years ago