Hi Try this,
$a = "fox comes and fox goes into forest"; $a =~ s#(fox.*?)(fox.*?forest)#$1the $2#gsi; print $a; [download]
In reply to Re: regexp find last word by gube in thread regexp find last word by Murcia