From: Martin DeMello Date: 2003-05-30T22:30:38+09:00 Subject: Re: substitution weirdness Brian Candler wrote: > On Fri, May 30, 2003 at 08:48:04PM +0900, Martin DeMello wrote: >> >> foo = "'123" >> puts foo.gsub(/'/) {'\\'+"'"} >> >> I find it more readable than the multiply-self-escaping string of >> backslashes. > > But '\\' and "\\" are the same thing (a single backslash) Yeah, that was simply a matter of defaulting to '' for constant strings unless I need a "'" > So concatenating two strings like that doesn't help you at all. Oops - so it doesn't. Please to ignore that post. What did help is that "\\'" doesn't seem to be magic in the {} form of gsub. martin