From: "Jesús Gabriel y Galán" Date: 2011-02-07T23:32:28+09:00 Subject: Re: Find in Array On Mon, Feb 7, 2011 at 3:22 PM, Benjamin S. wrote: > As I see it, with these methods i can only search for full strings. My > problem is, that i get a string and my search parameter is only a part > of this string (so find, include, find_index etc doesn't work...) You can use find/select with a regular expression: irb(main):037:0> a = %w{test test2 nothing something} => ["test", "test2", "nothing", "something"] irb(main):038:0> a.find {|x| /test/ =~ x} => "test" irb(main):039:0> a.select {|x| /test/ =~ x} => ["test", "test2"] irb(main):040:0> a.select {|x| /thing/ =~ x} => ["nothing", "something"] Jesus.