Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: regex help!

by ChrisR (Hermit)
on Sep 15, 2005 at 14:31 UTC ( [id://492240]=note: print w/replies, xml ) Need Help??


in reply to regex help!

Since I have seen no code or data, my response may be of no use at all. That being said, if your data looks anything like what is below and you are looking for the same nth field in each line, this may work for you.
use strict; use warnings; my $data = join "" , <DATA>; my @values = (); (@values) = $data =~ /[P|U|Pu]\n\d+,(\d+)/gx; print join '-', @values; exit; __DATA__ NP 1,2,3,4 U 5,6,7,8 Pu 9,10,11,12

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found