Regular Expressions 101

Community Patterns

Date

0

Regular Expression
PCRE (PHP <7.3)

/
(?:(?:Jan|Feb|Mar|Apr|May|June|July|Aug|Sept?|Oct|Nov|Dec)\.? +(?:[0-9]{1,2}\b,?)?(?: +)?)?\d{4}
/
gm

Description

Matches any date with a shortened month.

Example 1: Oct. 20, 2010 Example 2: Sep 10, 2020

Submitted by anonymous - 3 years ago