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
/
(<(p|li)\b[^<>]*>[^<>\n]*)\b(Cat|Dog|Fish)\b([^<>\n]*<\/\2>)
/
gm
Input 1
1
New
(1) <p> Cat test dfdsf</p> (2) <p> Cat.</p> (3) <p>Cat.</p> (4) <p class="test">Cat</p> (5) <li>Cat</li> (6) <p>Catfgdggh</p> (7) <div>Cat</div>
Substitution
$1lol$4