Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Re: pattern matching

by physgreg (Scribe)
on Aug 21, 2002 at 13:07 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (12)
As of 2024-04-23 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found