From: Austin Ziegler Date: 2003-04-01T13:15:33+09:00 Subject: Re: Change to /.../.match("foo") behaviour in 1.6.8? On Tue, 1 Apr 2003 12:24:07 +0900, dblack@superlink.net wrote: > On Tue, 1 Apr 2003, Yukihiro Matsumoto wrote: >>| In 1.6.7 and 1.7, I had the following line work: >>| l, m1, m2 = /((?:\S+\s+){11})(.+)/.match(line) >>| >>| This meant that #match return worked like an array. >> Put "*" before the expression, e.g. >> >> l, m1, m2 = */((?:\S+\s+){11})(.+)/.match(line) > > I'm getting confused.... It looks like 1.8 goes back to the 1.4 > behavior -- am I right about that? I must correct myself -- I was originally using the 1.7 release by PragProg. So my unit test would have failed under 1.6.7; I just never tested it to be sure. What I'm doing now: l = /((?:\S+\s+){11}(.+)/.match(line) And then using l[1] and l[2] is safer and more portable betweeen versions, IMO. I think that expecting #match to return an array in any case is a bad thing. But that's just IMO. -austin -- Austin Ziegler, austin@halostatue.ca on 2003.03.31 at 23:12:16