Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
~
^(?:https?:\/\/|www\.)\S+\/([^/\r\n]+)\/(\S+)$
~
gm
Input 1
1
New
https://foo/s3.amazonaws.com/TOP_PROD_IMAGE/WS-25612-BK_IMRO_1.jpg http://192.168.12.44:8090/TOP_PROD_IMAGE/R3CRDT-HZWT_IMRO_1.jpg www.foobar-images.s3.amazonaws.com/TOP_PROD_IMAGE/WS-25612-BK_IMRO_1.jpg
Substitution