in reply to Re^2: This regex seems to have splattered non-greedy everywhere
in thread This regex seems to have splattered non-greedy everywhere

Bug aside, your regex could use some refactoring. I'd suggest:
m{ ( [^']*? (?: '[^']*' [^']*? )* ) XX | (.+) $ }x
The unrolled loop of the first half and the $ anchor of the second half should control the performance.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^4: This regex seems to have splattered non-greedy everywhere
by fizbin (Chaplain) on Aug 10, 2005 at 20:12 UTC
    You realize that the unrolled loop is what I used as the equivalent version above, right? In fact, unrolling the loop like this (without the $ anchor) is exactly what I did to the java code to make performance jump back to fast-enough-not-to-matter.
    -- @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/