From: El Gato Date: 2006-11-21T11:14:41+09:00 Subject: Re: test content string with regex Bernard Kenik wrote: > > this is a ruby gotcha > > the only thing that returns false or false or nil > > 0 , '0', '''', an empty array, or an empty hash all evaluate to true Saying it's a "gotcha" makes it sound like the behavior is wrong. Some would say that only false should be false. Me, I like that nil is false, but I sure as hell don't want 0 or '' or [] or {} to be false. It behaves well -- that's not a gotcha -- that's just good common sense. I can't quite tell what you're looking for exactly, but String#match is probably it. (I don't like the =~ perlism myself). -- Posted via http://www.ruby-forum.com/.