From: lalawawa Date: 2010-01-26T02:50:06+09:00 Subject: Re: gsub problem Seebs wrote: > On 2010-01-25, lalawawa wrote: >> irb(main):005:0> a.gsub(/([\'\?])/, '\\\\\1') >> => "Can\\'t we\\?" > > This is probably what you want -- keep in mind that irb will show > you escaped backslashes if there's a single backslash in the string. > > -s You're right. irb(main):009:0> puts a.gsub(/([\'\?])/, '\\\\\1') Can\'t we\? => nil irb(main):010:0> Thanks