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
/
(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?
/
gm
Input 1
1
New
<a href=test.html class=xyz> <a href="test.html" class="xyz"> <a href='test.html' class="xyz"> <script type="text/javascript" defer async id="something" onload="alert('hello');"></script> <img src="test.png"> <img src="a test.png"> <img src=test.png /> <img src=a test.png /> <img src=test.png > <img src=a test.png > <img src=test.png alt=crap > <img src=a test.png alt=crap >
Extraction
<a href=test.html class=xyz> <a href="test.html" class="xyz"> <a href='test.html' class="xyz"> <script type="text/javascript" defer async id="something" onload="alert('hello');"></script> <img src="test.png"> <img src="a test.png"> <img src=test.png /> <img src=a test.png /> <img src=test.png > <img src=a test.png > <img src=test.png alt=crap > <img src=a test.png alt=crap >