Regular Expressions 101

Community Patterns

Date DD-MM-YYYY | DD/MM/YYYY | DD.MM.YYYY (ex. 28-02-2021) (leading zeros for month and day)

0

Regular Expression
Python

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

Description

For Dates formatted DD-MM-YYYY separated by Dot (.) Dash(-) or Slash(/) like (28–02-2021) with leading Zeros for single digit Month and Day.

Submitted by QuickRegEx - 3 years ago