From: matz@... (Yukihiro Matsumoto) Date: 2000-03-30T22:36:22+09:00 Subject: [ruby-talk:02264] Re: Multiple assignment of pattern match results. Hi, In message "[ruby-talk:02256] Multiple assignment of pattern match results." on 00/03/30, schneik@us.ibm.com writes: |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: a) x="aabbbccccdddeeeefffabcdeabcdeabcde" (dummy, t, u, v) = /(a+)[^ace]*(c+)[^e]*(e+)/.match(x).to_a b) t = u = v = nil x.scan(/(a+)[^ace]*(c+)[^e]*(e+)/) do |t,u,v| break end In message "[ruby-talk:02257] Re: Multiple assignment of pattern match results." on 00/03/30, mrilu writes: |I think it's time for String.scan(pattern[, limit]), like split. Interesting. matz.