Issue #5452 has been reported by Brian Ford.

----------------------------------------
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: 
Category: 
Target version: 
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