From: "Wolfgang Nádasi-donner" Date: 2007-08-02T19:19:25+09:00 Subject: Re: Multiple matching with ()* Alessandro Re wrote: > ...but i still think that one regex would have been nicer :) I don't think, that this will be "nice"... irb(main):001:0> "x1A2B3C4Dz".scan(/(?:\G|^(?:x))(x|\d\w|z)(?=(?:\d\w)*(?:z|)$)/) => [["x"], ["1A"], ["2B"], ["3C"], ["4D"], ["z"]] ..., and I didn't test it aganst wrong lines, but after a "flatten" it ends up with the required result. Wolfgang Nádasi-Donner -- Posted via http://www.ruby-forum.com/.