From: Isaac Sanders Date: 2011-12-03T21:43:53+09:00 Subject: Re: Is there a better way to check this array? --20cf30549ced0f3c0404b32f7058 Content-Type: text/plain; charset=ISO-8859-1 Why u no use hash? On Sat, Dec 3, 2011 at 7:25 AM, Wayne Brissette wrote: > > On Dec 3, 2011, at 6:23 AM, Ammar Ali wrote: > > > 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"] > > AH! Thanks! I was using it incorrectly. That will teach me to code before > I have two cups of coffee. :) > > Wayne > > > -- Sincerely, Isaac Sanders Section C-4B Vice Chief, Order of the Arrow Vice Chief of Administration, Tecumseh #65 Eagle Scout --20cf30549ced0f3c0404b32f7058--