From: Todd Benson Date: 2008-05-08T08:17:36+09:00 Subject: Re: Check if char in string? On Wed, May 7, 2008 at 5:19 PM, Todd Benson wrote: > On Wed, May 7, 2008 at 4:48 PM, Tim Hunter wrote: > > globalrev wrote: > > > > if str =~ /[aeiouy]/ > > do foo > > end > > > > [aeiouy] is a "character class". The regular expression tests if any > > character in the string is in the class. > > Get a good book on regular expressions. Trust me, it will seriously > help you in the long run for most any type of programming/system > interaction. If you want a quick look at some syntax, > http://www.regular-expressions.info might help. Note that, this is > only one of many ways to do what you are trying to do, but I think it > is the best way for this case. Hmm..hmm (cough). I was talking to globalrev, not Tim :/ Todd