Regular Expressions 101

Community Patterns

Date M-D-YYYY | M/D/YYYY | M.D.YYYY (ex. 9-2-2021) (without leading zeros for month and day)

0

Regular Expression
Python

r"
(?P<date>([1-9]|1[012])[-/.]([1-9]|[12][0-9]|3[01])[-/.]((19|20)\d{2}))
"
gm

Description

For Dates formatted M-D-YYYY separated by Dot (.) Dash(-) or Slash(/) like (9-2-2021) without leading Zeros for single digit Month and Day.

Submitted by QuickRegEx - 3 years ago