From: Ralph Shnelvar Date: 2010-11-21T07:13:28+09:00 Subject: gsub and backslashes ------------FA19714E10372EA1 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Consider the string \1\2\3 that is "\\1\\2\\3" I feel really stupid ... but this simple substitution pattern does not do what I expect. "\\1\\2\\3".gsub(/\\/,"\\\\") What I want is to change single backslashes to double backslashes. The result of the above substitution is "no change" On the other hand "\\1\\2\\3".gsub(/\\/,"\\\\\\\\") does do what I want ... but I am clueless as to why. ------------FA19714E10372EA1--