Hi,

At Mon, 18 Feb 2002 10:31:36 +0900,
David Corbin <dcorbin / imperitek.com> wrote:
> "if (x =~ /pat/)"  everything is OK.  When I trty to pass this 
> expression as an argument to a method expecting TrueClass or FalseClass, 
> I get a problem.  I assume that this expression is an Array of 
> "backreferences".  Is this correct?

Where `x' is a String, it returns the first position of /pat/
when matched, or nil.

>  If so, how can "coerce" this to be 
> a boolean as one uses in the if.?

(if x =~ /pat/ then true else false end)
(x =~ /pat/ ? true : false)
!(x !~ /pat/)

-- 
Nobu Nakada