From: Sam Duncan Date: 2013-03-01T05:42:50+09:00 Subject: Re: Match array1 with array2 On 01/03/13 07:10, Mattias A. wrote: > Thanks for your reply robert, but don't know how to use them.. > How about something like this? > irb irb(main):001:0> array1 = ['https://..../page.html', 'https://..../page1.html', 'https://..../page3.html'] => ["https://..../page.html", "https://..../page1.html", "https://..../page3.html"] irb(main):002:0> array2 = ['page.html', 'page2.html', 'page3.html', 'page4.html'] => ["page.html", "page2.html", "page3.html", "page4.html"] irb(main):003:0> array2.select { |page| array1.any? { |address| address.end_with? page } } => ["page.html", "page3.html"] Sam