I'm glad people took the sexeger approach, for which this is an excellent example. Other approaches, like:
s/two(?!.*two)//, and
s/two(?!.*?two)//, and
s/.*two//
suffer from things like slowness and too much backtracking.
_____________________________________________________
Jeff japhy Pinyan:
Perl,
regex,
and perlhacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
Comment on Re: Substitute _last_ occurence in string?