From: "shawn ." Date: 2009-05-07T16:48:06+09:00 Subject: [ruby-core:23386] [Bug #1441] String#gsub handles backslashes incorrectly Bug #1441: String#gsub handles backslashes incorrectly http://redmine.ruby-lang.org/issues/show/1441 Author: shawn . Status: Open, Priority: Normal ruby -v: ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] Was creating regexps in ruby and noticed this problem: "\\\\" => "\\\\" (printf => \\) "b".gsub("b","\\\\") => "\\" (printf => \) it takes 6 or 8 backslashes to get 2, its running something twice: "b".gsub("b","\\\\\\") => "\\\\" (printf => \\) everything is the same using single quotes also occurs in ruby1.9 (-v ruby 1.9.0 (2008-06-20 revision 17482) [x86_64-linux]) ---------------------------------------- http://redmine.ruby-lang.org