From: Dan Doel Date: 2003-08-18T08:32:23+09:00 Subject: Re: gsubbing ' to \' Try: result.gsub!(/'/) { "\\'" } Kurt M. Dresner wrote: >I was trying to escape some apostrophes with gsub. The only way I could >get it to work is by doing: > > result.gsub!(/'/) {%q!\'!} > >There has got to be a better way than this. What was I doing wrong? > >-Kurt > > > >