Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?:(\d+)\sYears?)?,?\s?(?:and\s)?(?:(\d+)\sMonths?)?,?\s?(?:and\s)?(?:(\d+)\sDays?)?$
/
gmi

Description

Parse the years/months/days from a string

Submitted by anonymous - 4 years ago