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/.