From: gminick Date: 2002-09-24T02:37:04+09:00 Subject: Re: another easy one... On Tue, Sep 24, 2002 at 01:09:45AM +0900, Mark Probert wrote: > Say, ch is a character and I want to find if it > exists in a regexp /A-Za-z0-9_/. How do I do it? > > irb> c.include?(/A-Za-z0-9_/) > "TypeError: cannot convert Regexp into String" Don't know if it is possible to use include? here, but you can do this with "=~": c =~ /[A-Za-z0-9_]/ Returns 0 if true, nil if false. HTH. -- [ Wojtek gminick Walczak ][ http://gminick.linuxsecurity.pl/ ] [ gminick (at) hacker.pl ][ gminick (at) underground.org.pl/ ]