From: Garance A Drosehn Date: 2004-08-18T05:18:29+09:00 Subject: Re: Bug in gsub with "\\" ? On Wed, 18 Aug 2004 05:02:41 +0900, mark sparshatt wrote: > > when Ruby parses the string "\\'" it converts it into "\'" which is > passed into gsub. within gsub \' is a reference to the part of the > string to the right of the part that matched, which is why you get the > results you're seeing. > > A way that would work is > > somestr.gsub(/'/, "\\\\'") > > or to stick to using the block form Ah. Okay -- thanks for the explanation! -- Garance Alistair Drosehn = drosihn@gmail.com Senior Systems Programmer Rensselaer Polytechnic Institute; Troy, NY; USA