title: Regex replace text outside script tag
body: <p>I have this HTML:</p>
  
  <pre>
  "This is simple html text &lt;script language="javascript"&gt;simple simple text text&lt;/script&gt; text"
  </pre>
  
  <p>I need to match only words that are outside script tag. I mean if I want to match “simple” and “text” I should get the results only from “This is simple html text” and the last part “text” — the result will be “simple” 1 match, “text” 2 matches. Could anyone help me with this? I’m using PHP.</p>
  
  <p>I found a similar answer for match text outside a tag:</p>
  
  <pre><code>(text|simple)(?![^&lt;]*&gt;|[^&lt;&gt;]*&lt;/)
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/18621568/regex-replace-text-outside-html-tags">Regex replace text outside html tags</a></p>
  
  <p>But couln't put to work for a specific tag (script):</p>
  
  <pre><code>(text|simple)(?!(^&lt;script*&gt;)|[^&lt;&gt;]*&lt;/)
  </code></pre>
  
  <p>ps: This question is not a duplicate (<a href="https://stackoverflow.com/questions/22781853/strip-tags-remove-javascript">strip_tags, remove javascript</a>). 'Cause i´m not trying to strip tags, or select the content inside the script tag. i´m trying replace content outside the tag "script".</p>