Use a lookahead:
$s = 'Goldman_Sachs_2002';; $s =~ s[_(?=.*_)][]g;; print $s;; GoldmanSachs_2002 [download]
In reply to Re: Simple substitution by BrowserUk in thread Simple substitution by eversuhoshin