标签: ruby jruby
为什么会这样?
irb(main):011:0> "\\\\".gsub("\\\\","\\") => "\\" irb(main):012:0> "\\".gsub("\\","\\\\") => "\\"
如果重要,使用jruby 1.7.21(相当于ruby 1.9.3)
编辑:或许更令人困惑......
irb(main):012:0> "\\".gsub("\\","\\\\\\") => "\\\\"