From: Robert Klemme Date: 2007-08-06T15:32:17+09:00 Subject: Re: Multiple matching with ()* 2007/8/4, Alessandro Re : > On 8/2/07, Wolfgang N�dasi-donner wrote: > > irb(main):001:0> > > "x1A2B3C4Dz".scan(/(?:\G|^(?:x))(x|\d\w|z)(?=(?:\d\w)*(?:z|)$)/) > > => [["x"], ["1A"], ["2B"], ["3C"], ["4D"], ["z"]] > > Wonderful :) > Thanks! But this does not seem to work with strings that contain multiple sections: irb(main):002:0> "x1A2B3C4Dz1a".scan(/(?:\G|^(?:x))(x|\d\w|z)(?=(?:\d\w)*(?:z|)$)/) => [] So it's not suited for a one RX approach and still need two levels of RX. If that's the case then we have seen simpler solutions for that. (Btw, one reason why it's so awkward is that there is no lookbehind in Ruby 1.8 - but this will change.) Kind regards robert