From: Simon Strandgaard Date: 2004-05-31T05:18:00+09:00 Subject: Re: gsub!, replace with \' Patrick Gundlach wrote: > Andreas Schwarz writes: > > > puts "hello".gsub!(/h/,"\\\\'") > > > > "\\" is reserved for backreferences. > > Hello Andreas, > > Oh, yes. This works fine. Thank you (and of course Simon). > Another way to obtain same result.. without extra escaping. puts "hello".gsub!(/h/) {|m| "\\'"} -- Simon Strandgaard