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
~
(?|<h3>(.+?)</h3>|<h4>(.+?)</h4>)
~
gs
Input 1
New
<h3>foo</h3> <h4>bar</h4> <h3>title</h4>
Substitution
<h3>foo</h3> <h4>bar</h4> <h3>title</h4>