title: Replacing script tags from java string
body: <p>Consider the below String</p>
  
  <pre><code>String html = "&lt;div&gt;test&gt; &lt;div /&gt;&lt;script &gt; docuement.alert()
                                                       &lt;/script&gt; &lt;p&gt;ptag&lt;/p&gt;";
  </code></pre>
  
  <p>I used regex to get it done by replacing script tags</p>
  
  <pre><code>    System.out.println(s.replaceAll("(?s)&lt;script.*?(/&gt;|&lt;/script&gt;)", ""));
  </code></pre>
  
  <p>That gave </p>
  
  <pre><code>&lt;div &gt;test&gt; &lt;div /&gt;suresh &gt;   &lt;p&gt;ptag&lt;/p&gt;
  </code></pre>
  
  <p>But I have been asked to convert into </p>
  
  <pre><code>&lt;div &gt;test&gt; &lt;div /&gt;&amp;lt;script &amp;gt;  docuement.alert()
                                                       &amp;lt;/script &amp;gt; &lt;p&gt;ptag&lt;/p&gt;
  </code></pre>
  
  <p>With <code>subString</code> and <code>indexOf</code>  I can achieve this , but i'm no clue of how to do it with a regex.</p>
  
  <p>Any help appreciated.</p>