title: How to delete string between two HTML tags in one row using bash script
body: <p>I have been working on some simple <code>bash</code> script recently, which parses specific data from webpages. I have used <code>tr '\r\n' ' ' &lt;file1.txt &gt;file2.txt</code> to make sure, all extracted data from page is stored in <code>file1.txt</code> in one row. So then I need to match all strings between <code>&lt;th&gt;...&lt;/th&gt;</code> tags in this line and delete them or replace with <code>' '</code> sign.
  So here is some expamle code:</p>
  
  <pre><code>    &lt;td&gt;Abaktal hm&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th&gt;Package&lt;/th&gt; &lt;td&gt;flm 10x400 mg&lt;/td&gt; &lt;th&gt;Indesit&lt;/th&gt;
  </code></pre>
  
  <p>I have used <code>sed</code> and tried something like</p>
  
  <pre><code>    sed -i 's/\&lt;th\&gt;.*?\&lt;\/th\&gt;/ /g' output.txt
  </code></pre>
  
  <p>But it didn't work. I think problem is in <code>?</code> sign. It works with <code>?</code> sign in regular expressions, but probably not in <code>bash</code>.</p>