From: Alessandro Re Date: 2007-08-02T18:23:53+09:00 Subject: Re: Multiple matching with ()* On 8/1/07, Harry Kakueki wrote: > 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/ > > Yep, it's like this. I solved using 2 instructions as you did: first matching extern words, then the middle ones, but i still think that one regex would have been nicer :) Thanks guys -- ~Ale