Remove the contents of block based on condition : <p>Below sed removes all occurrences of blocks between {content-start} and {content-end}, but want to remove only block contains the sting 'labtest'.</p>

<pre><code>sed -ie '/{content-start.*}/,/{content-end}/d' test.txt
</code></pre>

<p>test.txt</p>

<pre><code>{content-start}
abc1
labtest
def1
ghi1
{content-end}
{content-start}
abc2
def2
labtest
ghi2
{content-end}
{content-start}
abc3
def3
ghi3
{content-end}
</code></pre>
