From: Paul van Delst Date: 2006-10-21T02:05:10+09:00 Subject: Re: Problem modifying captured regexp results Pit Capitain wrote: > 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. Aha! That is the answer to the question (see my other post). Bewdy. Thanks Pit and Gavin. cheers, paulv -- Paul van Delst Ride lots. CIMSS @ NOAA/NCEP/EMC Eddy Merckx Ph: (301)763-8000 x7748 Fax:(301)763-8545