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]*?)(<article role="main">[\s\S]*<\/article>)(?:[\s\S]*)
/
g
Input 1
1
New
<chapter version="1.21" id="chapter_01"> <p>before</p> <article role="main">text content</article> <p>after</p> </chapter>
Substitution
<chapter version="1.21" id="chapter_01"> <p>before</p> <article role="main">text content</article> <p>after</p> </chapter>