I want to replace all ' by \' ? (I need it to do inserts in mysql). > s = "j'ai" > s.gsub!(/'/,'\'') > p s ==> gives j'ai and not j\'ai as I want Thanks for help.