Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^(((19|[2-9][0-9])[0-9][0-9])-((0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-8])|((0[13578]|1[02])-(29|30|31))|(0[469]|11)-(29|30)))|((19|[2-9][0-9])(00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)-02-29)$
/
gm
Unit Tests
1990/01/01
→ regex does not match
1990-01-01
→ regex does match
1990-01-31
→ regex does match
1990-01-00
→ regex does not match
1990-02-31
→ regex does not match
1990-01-14
→ regex does match
1990-04-31
→ regex does not match
1990-06-00
→ regex does not match
1990-09-30
→ regex does match
1991-02-29
→ regex does not match
1988-02-30
1988-02-29
→ regex does match
1991-02-29
→ regex does not match
1988-02-28
→ regex does match
1990/00/11
→ regex does not match
1990-13-11
→ regex does not match
1990-03-11
→ regex does match
0085-03-11
→ regex does not match
1899-03-11
→ regex does not match
1900-03-11
→ regex does match
1985-03-11
→ regex does match
2015-03-11
→ regex does match