title: Removing html tags with regex in Java
body: <p>First off, I understand that it is not ideal to parse html with regex.  However, I'm close to the solution I need, and I just can't quite get it right.</p>
  
  <p>Say you have html input in a string and you do:</p>
  
  <pre><code>content = content.replaceAll("&lt;[^\\P{Graph}&gt;]+&gt;", "");
  </code></pre>
  
  <p>This will essentially remove html tags except those with non-printable characters, space, tab, newline, and control characters.</p>
  
  <p>This is fine, except that there is a problem with the space character.  I need to <code>replaceAll</code> tags that look like:</p>
  
  <pre><code>&lt;ht ml&gt; (space somewhere in the middle)
  </code></pre>
  
  <p>but keep those that look like:</p>
  
  <pre><code>&lt; html&gt; (because this one contains a space as the FIRST character).
  </code></pre>
  
  <p>How can I adjust my regular expression for <code>replaceAll()</code> to accomplish this?  Thanks for any input/suggestions.</p>