From: "Mauricio Fernández" Date: 2003-12-23T07:01:28+09:00 Subject: Re: Yukihiro - Please ensure backwards compatibility On Tue, Dec 23, 2003 at 12:55:52AM +0900, John W. Long wrote: > Alexander Kellett wrote: > > >On Sat, Dec 20, 2003 at 10:31:53PM +0900, Martin DeMello wrote: > > > > > >>Elias Athanasopoulos wrote: > >> > >> > >>Well, for one, I think more people would expect it to be interpreted as > >>foo.gsub(Regexp.quote(bar), ...) > >> > >> > >/me nods > >i use this same paradigm frequently. > >its a bit icky for such a common action. > > > > > how about: > > foo.gsub!(/#{bar}/, ...) > > fairly concise. >> bar = "." => "." >> /#{bar}/.match "a" => # >> /#{Regexp.escape(bar)}/.match "a" => nil -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com * JHM wonders what Joey did to earn "I'd just like to say, for the record, that Joey rules." -- Seen on #Debian