Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?<range>\d{4}-\d{2}-\d{2}\.\.\d{4}-\d{2}-\d{2})|(?<day>\d{4}-\d{2}-\d{2})|(?<month>\d{4}-\d{2})|(?<quarter>\d{4}-Q\d)|(?<year>\d{4})
/
gm

Description

Patternmatching of several Daterange Patterns

=== Quarter 2021-Q2

=== Range 2021-02-01..2021-02-27

=== Year 2022

=== Month 2022-02

Submitted by Stefc - 3 years ago