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
/
<img (?:.*?class=['"](?!google[ '"])(?![^'"]* google['"]).+?['"]|(?!class=['"]))\s*[\/]?>
/
g
Input 1
1
New
<img src="https://google.com/animage.jpg" class="google"> <img src="https://yahoo.com/animage.jpg"> <img src="https://google.com/animage.jpg" class="google"> <img src="https://yahoo.com/animage.jpg" class="azerty"> <img src="https://yahoo.com/animage.jpg" class="not-a-google"> <img src="https://yahoo.com/animage.jpg" class="azerty still-not-a-google"> <img src="https://yahoo.com/animage.jpg" class="google-i-am-not"> <img src="https://yahoo.com/animage.jpg" class="azerty still-not-a-google" rel="google"> <img src="https://yahoo.com/animage.jpg" class="azerty still-not-a-google" rel="google"/> <img src="https://yahoo.com/animage.jpg" class="azerty still-not-a-google" rel="google" /> <img src="https://yahoo.com/animage.jpg" class="" rel="google" > <img src="https://yahoo.com/animage.jpg" class="totally-a google" rel="google" /> <img src="https://yahoo.com/animage.jpg" class='i-love-myhtml-with-single-quotes google' rel="google" /> <img src="https://yahoo.com/animage.jpg" class='i-love-myhtml-with-single-quotes not-a-google' rel="google" />
Substitution