Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s(\d\d?)(st|nd|rd|th)?,?\s(\d{4})|(\d\d?)[\.\/-](\d\d?)[\.\/-](\d{4})
/
gm

Description

Find dates of multiple formats in a clean way

Searchable Formats: -Month day year -Month day, year -Mon day year -Mon day, year -MM/DD/YYYY -MM.DD.YYYY -MM-DD-YYYY

Submitted by anonymous - a year ago