http://qs1969.pair.com?node_id=191717


in reply to Re: Re: pattern matching
in thread pattern matching

If you want to act on more than one id then try
while ($arrayElement =~ /:ID\s(\d*).*:P_ID\s(\d*)/g ) { print $1,$2,"\n"; # just an example }
The /g gets all matches of the regex, so the captured bit ($1,$2) will be updated for each match in the while loop.