title: Regex replace all in java
body: <p>I have a string containing some HTML content. I want to replace all the HTML tags and the content within them using Regex in java.</p>
  
  <p>So for example <code>&lt;a&gt;</code>,<code>&lt;a href=""/&gt;</code>,<code>&lt;/a&gt;</code> etc. should be removed.</p>
  
  <p>I tried</p>
  
  <pre><code>str=str.replaceAll("&lt;\\w*&gt;","");
  </code></pre>
  
  <p>but it replaces only the first occurrence from the string.</p>
  
  <p>How can I replace all the occurrences of this kind from the string.
  Thanks </p>