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
/
.+\/[^.\/]*?(?:\?.+)?$
/
gm
Input 1
1
New
http://www.example.com/ http://www.example.com/abc http://www.example.com/abc/def/ http://www.example.com/abc/def.ext/ http://www.example.com/abc?param=abc.def http://www.anything.com/abc/def.ext/?param=abc.ext http://www.example.com/abc.ext http://www.example.com/abc/def.ext http://www.anything.com/abc/def.ext?param=abc http://www.anything.com/abc/def.ext?param=abc.def
Substitution
http://www.example.com/ http://www.example.com/abc http://www.example.com/abc/def/ http://www.example.com/abc/def.ext/ http://www.example.com/abc?param=abc.def http://www.anything.com/abc/def.ext/?param=abc.ext http://www.example.com/abc.ext http://www.example.com/abc/def.ext http://www.anything.com/abc/def.ext?param=abc http://www.anything.com/abc/def.ext?param=abc.def