Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(?<century>1[2-9]|2[0-2])(?<year>\d{2})
/
gm

Description

This regex validates the year 1200-2299.

Submitted by anonymous - 5 years ago