From: dblack@... Date: 2002-09-24T02:47:06+09:00 Subject: Re: another easy one... Hi -- On Tue, 24 Sep 2002, Mark Probert wrote: > > My brain just isn't working this morn... > > 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" > > I can do: > > irb> c.count("A-Za-z0-9_") > 1 > > And look for a 0 being a non-match. Try: /\w/.match(ch) David -- David Alan Black | Register for RubyConf 2002! home: dblack@candle.superlink.net | November 1-3 work: blackdav@shu.edu | Seattle, WA, USA Web: http://pirate.shu.edu/~blackdav | http://www.rubyconf.com