Why does this happen?
irb(main):011:0> "\\\\".gsub("\\\\","\\")
=> "\\"
irb(main):012:0> "\\".gsub("\\","\\\\")
=> "\\"
Using jruby 1.7.21 if that matters (equivalent to ruby 1.9.3)
Edit: perhaps even more perplexingly...
irb(main):012:0> "\\".gsub("\\","\\\\\\")
=> "\\\\"