From: "Wolfgang Nádasi-donner" Date: 2007-08-01T06:41:24+09:00 Subject: Re: Multiple matching with ()* Alessandro Re wrote: > For example, trying with > "x1A2B3C4Dz".scan /^(x)(\d\w)*(z)$/ > returns > [["x", "4D", "z"]] > while i need something like > [["x", "1A", "2B", "3C", "4D", "z"]] Does this goes more into the direction you wanted: irb(main):001:0> "x1A2B3C4Dz".scan /(?:^(?:x)|\G)(\d\w)(?=(?:\d\w)*(?:z)$)/ => [["1A"], ["2B"], ["3C"], ["4D"]] ??? Wolfgang Nádasi-Donner -- Posted via http://www.ruby-forum.com/.