From: "Jan E." Date: 2012-09-09T23:53:15+09:00 Subject: Re: Match an ARray Element by if I have to revise my previous post: Since sname is a completely new array, it cannot contain two strings "test1" and "test2" but only one string consisting of two lines. Something like "test1\ntest2" Which yields the question what you actually want: Split the string into lines and then save these lines in an array? Or simply check if one of the lines equals "test1"? This would be res2 =~ /^test1$/ -- Posted via http://www.ruby-forum.com/.