I don\'t understand this Ruby code:
>> puts \'\\\\ <- single backslash\' # \\ <- single backslash >> puts \'\\\\ <- 2x a, because 2 bac
the pickaxe book mentions this exact problem, actually. here's another alternative (from page 130 of the latest edition)
str = 'a\b\c' # => "a\b\c" str.gsub(/\\/) { '\\\\' } # => "a\\b\\c"