Victor Shepelev wrote:
> if match_result
> ...
> end
> 
> because in Ruby only nil and false are "false", where any other value
> (including 0, '' and []) are "true".

Yep, thank you to you and David.  I forgot that I could rewrite it like 
that.

Kevin wrote:
> You could just do this...
> if string =~ /(\w)/
>   #do something with $1
> end

Well, in this particular case, I am using the Fixnum returned, which is 
why I am making the assignment.  I normally otherwise do as you say, 
using "if string =~ /regexp/".

Pistos

-- 
Posted via http://www.ruby-forum.com/.