Project

General

Profile

Actions

Bug #3833

closed

"foo+bar".gsub("+","\\+") == "foobar" ?

Bug #3833: "foo+bar".gsub("+","\\+") == "foobar" ?

Added by grant (Grant Olson) over 15 years ago. Updated almost 15 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
tryruby.org (I'm running 1.8.7 locally, same problem)
Backport:
[ruby-core:32404]

Description

=begin
The following gsub with a minus seems to work correctly:

>> "foo-bar".gsub("-","\-")
=> "foo\-bar"

But with a plus, it seems to run incorrectly by stripping the plus:


"foo+bar".gsub("+","\+")
=> "foobar"
=end

Actions

Also available in: PDF Atom