Regular Expressions 101

Community Patterns

0

silly radio

PCRE2 (PHP >=7.3)
nuh uh
Submitted by anonymous - 6 months ago

dd-mm-YYYY HH:mm:ss (year range 1000-2999)

-18

Regular Expression
PCRE (PHP <7.3)

/
^(?<day>0[1-9]|1\d|2[1-8]|29(?=-\d{2}-(?!1[26]00|2[048]00)\d{2}(?:[02468][048]|[13579][26]))|30(?!-02)|31(?=-0[13578]|-1[02]))-(?<month>0[1-9]|1[0-2])-(?<year>[12]\d{3}) (?<hour>[01]\d|2[0-3]):(?<minute>[0-5]\d):(?<second>[0-5]\d)$
/
gm

Description

Loading markdown...
Submitted by Ka. - 11 years ago
(Last modified 4 months ago)