From: James Edward Gray II Date: 2006-07-26T21:56:19+09:00 Subject: Re: gsub On Jul 26, 2006, at 6:47 AM, Vincent Fourmond wrote: > > Hello ! > >> s.gsub(/XX\z/,'') solves the problem in a static way. >> s.gsub(r,'') solves it too, but who can I specify, that only the last >> occurence should be replaced. > > Would > s.gsub(/#{r}$/,'') > do what you want ? If that's for a single line string, drop the g and just use sub(). James Edward Gray II