From: Siep Korteling Date: 2008-11-11T17:26:14+09:00 Subject: Re: Comparing variable to multiple values Robert Klemme wrote: > On 11.11.2008 01:56, Brian Adkins wrote: >> >> puts 'good' if a =~ /word[1-3]/ >> >> or >> >> puts 'good' if a =~ /word\d+/ > > You forgot the anchors. Your regexp will also match "fooword1bar" which > was not intended by OP. (...) > > Kind regards > > robert Is this a bug? ("word1".."word3").each{|w| puts w} => word1 => word2 => word3 puts "good" if ("word1".."word3").include?("word1bar") => good If so, what am I supposed to do? Siep -- Posted via http://www.ruby-forum.com/.