Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
Validation of Date in the format YYYY-MM-DD
Open Workspace
PCRE2 (PHP)
Match
Updated 2025-11-05 19:05
0
Regular Expression
/
(?<=
(
^
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
Validation of Date in the format YYYY-MM-DD
Submitted by
David