in reply to Re^2: regexp find last word
in thread regexp find last word

You can remove the (redundant) .* from Roy Johnson's.

I don't know if it helps any, but you can remove the lookahead too:
s/(fox(?:(?!fox).)*forest)/the $1/;

Replies are listed 'Best First'.
Re^4: regexp find last word
by Roy Johnson (Monsignor) on Mar 02, 2005 at 15:50 UTC
    I removed the redundant .* about 2 minutes after I posted it. People see things quick around here.

    Caution: Contents may have been coded under pressure.