Regular Expressions 101

Community Library

Community Library Entry

0

Regular ExpressionOpen Workspace

/
(?<=(^19\d\d|^20\d\d)-02-)(0[1-9]|1[0-9]|2[0-9])$|^(19\d\d|20\d\d)-(0[469]|11)-(0[1-9]|1[0-9]|2[0-9]|30)$|^(19\d\d|20\d\d)-(0[13578]|12)-(0[1-9]|1[0-9]|2[0-9]|3[01])$
/
gm

Description
Created·2025-11-04 10:36
Updated·2025-11-05 19:05
Type·Match
Flavor·PCRE2 (PHP)

Validation of Date in the format YYYY-MM-DD

Submitted by David
Open Workspace