From: Leo Date: 2009-02-25T02:26:27+09:00 Subject: Re: String#gsub escaping special characters > The backslash in the string is first interpreted by ruby and then as > regexp substitution pattern. This \\x becomes \x as substitution > pattern but that really is just x then because there is no special > substitution for \x. In order to replace x with \x, the substitution > has to be \\x but since this is a string parsed by ruby before it gets > there you have to escape those backslashes and make it "\\\\x". Or more likely, I was thinking of another language, which probably explains my faulty explanation. You're right. Note to self: Never post without testing what you are posting. Sorry. -- Leo The end is here -->