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
r"
^/2\d{3}(?:/2\d{3}-(?:0[1-9]|1[0-2])(?:/[a-z ]+(?:/[go](?:/s)?)?)?)?$
"
gm
Input 1
New
Examples of correct paths: /2020/2020-05/test/o /2020/2020-05/test/o/s (maximum, a nothing can be yet at the end) /2020/2020-05/test /2020/2020-05 /2020 Examples of incorrect paths: /2020/2020/2020-05/test/o/smth /2020/2020-05/test/test/o /2020/2020-05/test/o/o/smth /2020/2020-05/test/o/test