I've stumbled over strange String#gsub behavior. >> "a'b'c'd".gsub("'", "\\'") => "ab'c'dbc'dcdd" Is it a bug or have I missed something in docs?