Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
PCRE (PHP <7.3)

~
(\s*)(\d+)?(\.\d+)?(\s*)(?i:years|year|yrs|y|months|month|m)?(\s*)(/)?(\s*)(\d+)?(\.\d+)?(\s*)(?i:years|year|yrs|y|months|month|m)?(\s*)(-)?(\s*)(\d+)(\.\d+)?(\s*)?(?i:years|year|yrs|y|months|month|m)
~
igm