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
r"
(TAG|CORE)START(?: B)?(.+?)(\1END(?: B)?)
"
sg
Input 1
New
intro intro intro intro intro intro BEGIN A This is where some text starts That is not interesting or wanted CORESTART save text A save text A save text A save text A save text A save text A save text A save text A save text A save text A COREEND This is an addendum that is not needed but is just in the way END A outro outro outro outro outro outro outro outro outro outro outro outro outro . intro intro intro intro intro intro INIT B This is where some text starts That is not interesting or wanted TAGSTART B save text B save text B save text B save text B save text B save text B save text B save text B save text B save text B TAGEND B This is an addendum that is not needed but is just in the way TERM B outro outro outro outro outro outro outro outro outro outro outro outro outro
Substitution
intro intro intro intro intro intro BEGIN A This is where some text starts That is not interesting or wanted CORESTART save text A save text A save text A save text A save text A save text A save text A save text A save text A save text A COREEND This is an addendum that is not needed but is just in the way END A outro outro outro outro outro outro outro outro outro outro outro outro outro . intro intro intro intro intro intro INIT B This is where some text starts That is not interesting or wanted TAGSTART B save text B save text B save text B save text B save text B save text B save text B save text B save text B save text B TAGEND B This is an addendum that is not needed but is just in the way TERM B outro outro outro outro outro outro outro outro outro outro outro outro outro