From: Gary Yngve Date: 2009-02-25T01:38:35+09:00 Subject: String#gsub escaping special characters --000e0cd150b67350ec0463aca875 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Ugh, just got bitten by trying to replace ' w/ \' in a string (backslash apostrophe). Turns out that \' is a regex interpolator, just like \1, \2, so "a'b'c'd".gsub("'","\\'") did not work, nor did it with the 2nd param as '\\\''. The magic incantation from trial and error is: "\\\\\'" Yuck! Online documentation could certainly be improved. -Gary --000e0cd150b67350ec0463aca875--