Community Patterns

Community Library Entry

0

Regular Expression
Created·2023-01-25 11:33
Flavor·PCRE2 (PHP)

/
^(?:(?:31(?:0[13578]|1[02])|(?:30|29)(?:0[13-9]|1[0-2])|(?:0[1-9]|1[0-9]|2[0-8])(?:0[1-9]|1[0-2]))[0-9]{2}-?[0-9]|290200-?[4-9]|2902(?:(?!00)[02468][048]|[13579][26])-?[0-3])[0-9]{3}|000000-?0000$
/
gm
Open regex in editor

Description

This one makes sure to not match 31 in months where it does not exist and cuts off february at 28. Might need to do special check for 29th of february ..?

Submitted by anonymous