in reply to why this regular expression is so slow?

None of these examples "work", since you have included htlm entities (&#93;, ...) in your regex. Please edit your code so it contains the real characters you want to match, there is no need to encode the characters within the <code> ... </code>-tags.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: why this regular expression is so slow?
by AnomalousMonk (Archbishop) on Jul 15, 2009 at 06:47 UTC
    CounterZero++

    And BTW, fnever: what's with the long string of <BR />s in the middle of the OP? Please Update that.