It doesn't put the [] character class brackets in, so the example
doesn't work. I checked this with ri/ruby 1.6 and ri/ruby 1.8.


From ri Regexp.===:
------------------------------------------------------------- Regexp#===
     rxp === aString -> true or false
------------------------------------------------------------------------
     Case Equality---Synonym for Regexp#=~ used in case statements.
        a = "HELLO"
        case a
        when /^a-z*$/; print "Lower case\n"
        when /^A-Z*$/; print "Upper case\n"
        else;            print "Mixed case\n"
        end
     produces:
        Upper case


But:



        a = "HELLO"
        case a
        when /^a-z*$/; print "Lower case\n"
        when /^A-Z*$/; print "Upper case\n"
        else;            print "Mixed case\n"
        end
        # Added [] to regexps:
        case a
        when /^[a-z]*$/; print "Lower case\n"
        when /^[A-Z]*$/; print "Upper case\n"
        else;            print "Mixed case\n"
        end

Produces:

Mixed case
Upper case


I've attached a doc patch.

Cheers,
Sam