From: Harry Kakueki Date: 2007-08-01T08:49:58+09:00 Subject: Re: Multiple matching with ()* On 7/31/07, Alessandro Re wrote: > while i need to be sure that the pattern begins with a regex "x" and > ends with "z" > > (of course, x 1 a 2 b 3 c should be regexes not just chars) > Sorry, I misunderstood what you wanted. Is this more like it? str = "lol1a2vasd" m = /^(\w{3})(.*)(\w{3})$/.match(str).captures m[1] = m[1].scan(/\d\w/) p m.flatten #> ["lol","1a","2v","asd"] Harry -- A Look into Japanese Ruby List in English http://www.kakueki.com/