From: ts Date: 2005-09-29T23:07:05+09:00 Subject: Re: Backslashes >>>>> "H" == Han Holl writes: H> Is this a bug, or should it be specially documented ? Well, it's documented but in the FAQ Regexp.quote('\\') escapes a backslash. It gets trickier if you're using sub and gsub, Say you write gsub(/\\/, '\\\\'), hoping to replace each backslash with two. The second argument is converted to '\\' in syntax analysis. When the substitution occurs, the regular expression engine converts this to '\', so the net effect is to replace each single backslash with another single backslash. You need to write gsub(/\\/, '\\\\\\')! Guy Decoux