From: Ammar Ali Date: 2011-12-03T21:23:20+09:00 Subject: Re: Is there a better way to check this array? On Sat, Dec 3, 2011 at 2:06 PM, Wayne Brissette wrote: > Thanks. Both of these have given me more food for thought. I knew grep should have worked. The issue Ammar that I see with it though is I have to pass item via a variable and that doesn't seem to be working very well. The any? option Peter suggested does however seem to work. I'll need to see if I notice any performance issues using it though. > FYI, you can use variables inside the regular expression. >> name = "fred" => "fred" >> names.grep /#{name}/i => ["fred,9"] Regards, Ammar