Issue #5452 has been updated by Hiroshi Nakamura.

Category set to core
Status changed from Rejected to Open
Assignee set to Shyouhei Urabe
Target version set to Ruby 1.8.7

It's fixed by #1953 and r25576 by Matz.

I re-open this for making sure Shyouhei can decide whether it's backportable or not.
----------------------------------------
Bug #5452: String#squeeze[!] with negated out-of-order sequence behaves like no argument was passed
http://redmine.ruby-lang.org/issues/5452

Author: Brian Ford
Status: Open
Priority: Normal
Assignee: Shyouhei Urabe
Category: core
Target version: Ruby 1.8.7
ruby -v: ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10.8.0]


See the examples below:

String#squeeze!

$ ruby -e 'p "-subbookkeeper-".squeeze!("b-e")'
"-subookkeper-"

$ ruby -e 'p "-subbookkeeper-".squeeze!("^b-e")'
"-subbokeeper-"

$ ruby -e 'p "-subbookkeeper-".squeeze!("e-b")'
nil

$ ruby -e 'p "-subbookkeeper-".squeeze!("^e-b")'
"-subokeper-"

^^^ This looks like a bug

$ ruby -e 'p "-subbookkeeper-".squeeze!'
"-subokeper-"


String#squeeze

$ ruby -e 'p "-subbookkeeper-".squeeze("e-b")'
"-subbookkeeper-"

$ ruby -e 'p "-subbookkeeper-".squeeze("^e-b")'
"-subokeper-"

^^^ And so does this

$ ruby -e 'p "-subbookkeeper-".squeeze'
"-subokeper-"

Thanks,
Brian


-- 
http://redmine.ruby-lang.org