Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You're processing each file five times, so the first thing you should do (as Paul Sanwald said) is try to reduce that number by combining your regexes together. I would also avoid using reluctant quantifiers, which are designed for convenience at the expense of efficiency. Consider this regex:</p> <pre><code>&lt;script.*?&lt;/script&gt; </code></pre> <p>Each time the <code>.</code> goes to consume another character, it first has to make sure <code>&lt;/script&gt;</code> won't match at that spot. It's almost like doing a negative lookahead at every position:</p> <pre><code>&lt;script(?:(?!&lt;/script&gt;).)*&lt;/script&gt; </code></pre> <p>But we know there's no point doing the lookahead if the next character is anything but <code>&lt;</code>, and we can tailor the regex accordingly:</p> <pre><code>&lt;script[^&lt;]*(?:&lt;(?!/script&gt;)[^&lt;]*)*&lt;/script&gt; </code></pre> <p>When I test them in RegexBuddy with this target string:</p> <pre><code>&lt;script type="text/javascript"&gt;var imagePath='http://sstatic.net/stackoverflow/img/';&lt;/script&gt; </code></pre> <p>...the reluctant regex takes 173 steps to make the match, while the tailored regex takes only 28.</p> <p>Combining your first three regexes into one yields this beast:</p> <pre><code>&lt;(?:(script|style)[^&lt;]*(?:&lt;(?!/\1)[^&lt;]*)*&lt;/\1&gt;|[!/]?[a-zA-Z-]+[^&lt;&gt;]*&gt;) </code></pre> <p>You might want to zap the <code>&lt;HEAD&gt;</code> element while you're at it (i.e., <code>(script|style|head)</code>).</p> <p>I don't know what you're doing with the fourth regex, for character entities--are you just deleting those, too? I'm guessing the fifth regex has to be run separately, since some of the whitespace it's cleaning up is generated by the earlier steps. But try it with the first three regexes combined and see how much difference it makes. That should tell you if it's worth going forward with this approach.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload