title: How to delete <a> tag and link text from html in java
body: <p>I want to delete <code>&lt;a&gt;</code> tag and link text from my html.</p>
  
  <p>Simple example:</p>
  
  <pre><code>String inputString = "&lt;html&gt;&lt;p&gt;test &lt;a href="example.com"&gt;link&lt;/a&gt; &lt;/p&gt;&lt;/html&gt;";
  </code></pre>
  
  <p>I tried to use something like this:</p>
  
  <pre><code>String result = inputString.replaceAll("&lt;/?a[^&gt;]*&gt;", " ");
  </code></pre>
  
  <p>but it deletes only <code>&lt;a&gt;</code> tag</p>
  
  <p>Expected output:</p>
  
  <pre><code>String result = "&lt;html&gt;&lt;p&gt;test&lt;/p&gt;&lt;/html&gt;";
  </code></pre>