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
@
^gallery/country(?:/[^/]*([a-zA-Z-9]{2}))?/?$
@
gm
Input 1
1
New
gallery/country gallery/country/ gallery/country/ie gallery/country/ie/ gallery/country/ireland gallery/country/ireland/ gallery/country/ireland-love.ie gallery/country/ireland-love.ie/ gallery/country/ireland.69-love.ie/
Extraction
gallery/country gallery/country/ gallery/country/ie gallery/country/ie/ gallery/country/ireland gallery/country/ireland/ gallery/country/ireland-love.ie gallery/country/ireland-love.ie/ gallery/country/ireland.69-love.ie/