title: Removing all HTML tags from a webpage
body: <p>I am doing some BASH shell scripting with <code>curl</code>. If my curl command returns any text, I know I have an error. This text returned by <code>curl</code> is usually in HTML. I figured that if I can strip out all of the HTML tags, I could display the resulting text as an error message. </p>
  
  <p>I was thinking of something like this:</p>
  
  <pre><code>sed -E 's/&lt;.*?&gt;//g' &lt;&lt;&lt;$output_text
  </code></pre>
  
  <p>But I get <code>sed: 1: "s/&lt;.*?&gt;//": RE error: repetition-operator operand invalid</code></p>
  
  <p>If I replace <code>*?</code> with <code>*</code>, I don't get the error (and I don't get any text either). If I remove the <em>global</em> (<code>g</code>) flag, I get the same error.</p>
  
  <p>This is on Mac OS X.</p>