From: pere.noel@... (=?ISO-8859-1?Q?Une_b=E9vue?=) Date: 2006-03-23T23:13:52+09:00 Subject: understanding aRegexp === aString i'm experiencing with regexp and ruby and follo the page at "===" i've found an example : a = "HELLO" case a when /^a-z*$/; print "Lower case\n" when /^A-Z*$/; print "Upper case\n" else; print "Mixed case\n" end saying it produces : # => Upper case i got : Mixed case why this discrapency, if any ??? is that due to the fact my script file is UTF-8 encoded ??? also with : truc = 'toto' rgx=Regexp.new('^toto$') flag=(truc =~ rgx)? true : false p "flag = #{flag}" # => "flag = true" flag=(truc === rgx) /// this one i don't understand the result p "flag = #{flag}" # => "flag = false" flag=(truc == rgx) p "flag = #{flag}" # => "flag = false" flag=(truc =~ rgx) p "flag = #{flag}" # => "flag = 0" why, when aString = 'toto' and ARegexp = Regexp.new('^toto$') the equality "===" returns false ??? -- une b�vue