Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: pattern matching

by physgreg (Scribe)
on Aug 21, 2002 at 13:07 UTC ( #191717=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://191717]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2022-08-19 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?