From: Bill Kelly Date: 2005-01-20T03:11:46+09:00 Subject: gsub and \\\\ Hi, I'm probably being dense, but - >> "ab\\cd".gsub(/\\/, "\\\\") => "ab\\cd" I expected the above to produce "ab\\\\cd" If i add a character in between the \\\\, then I do get two backslashes in the result: >> "ab\\cd".gsub(/\\/, "\\a\\") => "ab\\a\\cd" If I add a third backslash in the replacement string, then I get two in the result: >> "ab\\cd".gsub(/\\/, "\\\\\\") => "ab\\\\cd" Is this the expected behavior? If so, what's the principle I need to know to understand it? :) (ruby 1.8.2 (2004-07-29) [i386-mswin32] and ruby 1.8.2 (2004-11-06) [i686-linux]) Thanks, Regards, Bill