in reply to really non greedy match

/START(?:(?!START|END).)*END/
/START(?:(?!START).)*?END/
I wonder if the following is faster
/ START (?> [^SE]* (?:S+(?!TART))? (?:E+(?!ND))? )* END /x

Replies are listed 'Best First'.
Re^2: really non greedy match
by Allasso (Monk) on Apr 24, 2010 at 21:44 UTC
    Ah, thanks. I was on the right track, but I was missing the "any character" right after the innermost group and wasn't getting a match at all. I am wondering why that is necessary?

      [ Please don't place your entire post in code tags. Just put a <p> at the start of every paragraph. ]

      Your asking me to explain why your pattern didn't work without showing me your pattern.