From: Robert Klemme Date: 2005-01-20T21:11:06+09:00 Subject: Re: gsub and \\\\ "Florian Gross" schrieb im Newsbeitrag news:357nbmF4j4bmmU1@individual.net... > Bill Kelly wrote: > > > I'm probably being dense, but - > > > >>>"ab\\cd".gsub(/\\/, "\\\\") > > Here's the details, this comes up frequently: In fact we could make this thread sticky - if that were possible with news and mail readers. :-) Just to add one point to your excellent explanation: Another source of confusion in this context is irb which uses String#inspect which in turn adds escaping again: irb(main):001:0> s = "a\\b" => "a\\b" irb(main):002:0> puts s a\b => nil Kind regards robert