in reply to Re: regexp find last wordin thread regexp find last word
or s/(fox(?:(?!fox).)*forest)/the $1/;
Update: nm, capture makes it slower.