title: sed multiline replace
body: <p>this is my sample text file :</p>
  
  <pre>
  asdas
  //&lt;&lt;&lt;TAG
  this should be removed
  //TAG&gt;&gt;&gt;
  this should be there
  //&lt;&lt;&lt;TAG
  T
  >
  asd
  asd
  //TAG&gt;&gt;&gt;
  </pre>
  
  <p>for which i want o/p as :</p>
  
  <pre>
  asdas
  
  this should be there
  </pre>
  
  <p>Basically i m trying to find lines between "//&lt;&lt;>>" (including these lines too) and delete them.</p>
  
  <p>I tried using sed </p>
  
  <blockquote>
    <p>sed -n
    '1h;1!H;${;g;s///&lt;&lt;]*TAG>>>//g;p;}'
    &lt; test.txt</p>
  </blockquote>
  
  <p>But some how it did not produced correct output. The second tag which contained ">" symbol failed in regex. Not sure where i m going wrong?</p>
  
  <p>Any idea how to do it ? </p>