From: mrilu Date: 2000-03-30T10:04:20+02:00 Subject: [ruby-talk:02257] Re: Multiple assignment of pattern match results. On Thu, 30 Mar 2000 schneik@us.ibm.com wrote: > The only problem I have with this example is that scan is going through the > work of producing an array of arrays, even though I only want the first > match: > > irb(main):003:0> (t, u, v) = x.scan(/(a+)[^ace]*(c+)[^e]*(e+)/) > [["aa", "cccc", "eeee"], ["a", "c", "e"], ["a", "c", "e"], ["a", "c", "e"]] I think it's time for String.scan(pattern[, limit]), like split.