From: Pit Capitain Date: 2006-10-21T01:22:38+09:00 Subject: Re: Problem modifying captured regexp results Paul van Delst schrieb: > (...) > > if line =~ componentRegexp > # We have matched an array component definition > arrayList<<{"type"=>$1, > "param"=>$2, > "dimlist"=>$3.split(/\s*,\s*/), # <--- split dimlist > "name"=>$4, > "description"=>$5} > > but I've found that the above operation on the $3 captured result > appears to "wipe" the subsequent entries $4 (name) and $5 (description). Paul, the problem is that #split with a Regexp internally executes some Regexp matches which change $1, $2 etc. You have to capture the results of the first match before executing the split. Regards, Pit