From: matt@... (matt neuburg) Date: 2009-02-25T04:04:33+09:00 Subject: Re: String#gsub escaping special characters Gary Yngve wrote: > [Note: parts of this message were removed to make it a legal post.] > > On Tue, Feb 24, 2009 at 8:31 AM, Gary Yngve wrote: > > > The magic incantation from trial and error is: > > "\\\\\'" > > > > that should be "\\\\'" or '\\\\\''. > > i feel dirty now. This comes up a lot, including in a post of mine where I tripped over much the same thing. The real solution is: except in very simple cases, don't use gsub(/regex/, "string"); use the block form instead. m. -- matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/ Leopard - http://www.takecontrolbooks.com/leopard-customizing.html AppleScript - http://www.amazon.com/gp/product/0596102119 Read TidBITS! It's free and smart. http://www.tidbits.com