Hi,

In message "[ruby-talk:02256] Multiple assignment of pattern match results."
    on 00/03/30, schneik / us.ibm.com <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 <mrilu / ale.cx> writes:

|I think it's time for String.scan(pattern[, limit]), like split.

Interesting.

							matz.