> So now my code is
> 
> if match_result != nil and match_result != false
> ...
> end

AFAIK, it's an equivalent for simple

if match_result
...
end

because in Ruby only nil and false are "false", where any other value
(including 0, '' and []) are "true".

Victor.