From: Harry Kakueki Date: 2007-07-31T23:01:13+09:00 Subject: Re: Multiple matching with ()* On 7/31/07, 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"]] > Hi, Try this. str = "x1A2B3C4Dz" p str.scan(/\d?\w/) #>["x", "1A", "2B", "3C", "4D", "z"] Harry -- A Look into Japanese Ruby List in English http://www.kakueki.com/