Consider this irb session:

irb(main):001:0> s = "thestring"
"thestring"
irb(main):002:0> s.gsub(/(s)/, '\\')
"the\\tring"
irb(main):003:0> s.gsub(/(s)/, '\\')
"the\\tring"
irb(main):004:0> s.gsub(/(s)/, '\1\\')
"thes\\tring"
irb(main):005:0> s.gsub(/(s)/, '\\\1')
"the\\1tring"

All are correct except for the last -- I expect the last one to be
"the\\string".

-- 
matt

  Piki, you handsom cat, rest in peace  http://www.lickey.com/piki/