From: matt@... (matt neuburg) Date: 2008-05-04T00:35:17+09:00 Subject: Re: n00b string replace wrote: > irb(main):003:0> sst = st.gsub(/'/,"\'") You can really confuse the heck out of yourself this way. There are two problems: (1) Backslashes must be escaped in a double-quoted string. (2) gsub has special behavior unlike anything else in Ruby: backslashes are unescaped in the second parameter, regardless of the quoting. So, if you want one backslash to be substituted, and if you insist on double-quoting, you have to type *four* backslashes: irb(main):003:0> puts "hello".gsub("e","\\\\") h\llo For the workaround, check this recent thread: 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