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
/
<a(.*?)href=('|\")([^\>]*).(jpe?g|png|gif|mp4|webp|bmp)('|\")(.*?)>
/
ig
Input 1
<a href="https://localhost/test" target="_blank">TEST</a> <a href="http://localhost/test.jpg" data-fancybox="fancybox" data-caption=""> <img src="https://localhost/test-400x400.jpg" alt=""> </a> <a href="https://localhost/te.2er44.-.awd.wd.ddwadst.jpg"> <img src="https://localhost/test-400x400.jpg" alt=""> </a> <a href="https://localhost/test.svg"> <img src="https://localhost/test-400x400.jpg" alt=""> </a> <a href="https://localhost/test.gif"> <img src="https://localhost/test-400x400.jpg" alt=""> </a>
Extraction
<a href="https://localhost/test" target="_blank">TEST</a> <a href="http://localhost/test.jpg" data-fancybox="fancybox" data-caption=""> <img src="https://localhost/test-400x400.jpg" alt=""> </a> <a href="https://localhost/te.2er44.-.awd.wd.ddwadst.jpg"> <img src="https://localhost/test-400x400.jpg" alt=""> </a> <a href="https://localhost/test.svg"> <img src="https://localhost/test-400x400.jpg" alt=""> </a> <a href="https://localhost/test.gif"> <img src="https://localhost/test-400x400.jpg" alt=""> </a>