On 4/26/07, Yukihiro Matsumoto <matz / ruby-lang.org> wrote:

> It was intentional to escape backslashes in replacement string.
> If it were a bug, how do we escape backslashes?  Any idea?

Why does his second example:

    '\\'.gsub('\\', '\\\\\\')

result in "\\\\" (with four backslashes) instead of "\\\" (with three)?