title: How to find "<script>" tag from the string with JAVASCRIPT/ regular expression
body: <p>I need to validate the incoming string for text <code>&lt;script</code>. </p>
  
  Example:
  
  <pre><code>string a = "This is a simple &lt;script&gt; string";
  </code></pre>
  
  <p>Now, I need to write a regular expression that will tell me whether this string contains a <code>&lt;script&gt;</code> tag or not.</p>
  
  <p>I ended up writing something like: <code>&lt;* ?script.* ?&gt;</code></p>
  
  <p>But the challenge is, 
  Incoming string may contain script in following ways,</p>
  
  <pre><code>string a = "This is a simple &lt;script&gt; string";
  string a = "This is a simple &lt; script&gt; string";
  string a = "This is a simple &lt;javascript&gt;&lt;/javascript&gt; string";
  string a = "This is a simple &lt;script type=text/javascript&gt; string";
  </code></pre>
  
  <p>Hence the regular expression should check for starting <code>&lt;</code> tag and then it should check for <code>script</code>.</p>