Regular Expressions 101

Community Patterns

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

0

Regular Expression
Python

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

Description

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

Submitted by QuickRegEx - 3 years ago