Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: regex problem

by writch (Sexton)
on Mar 06, 2018 at 16:06 UTC ( [id://1210412]=note: print w/replies, xml ) Need Help??


in reply to regex problem

I just split it into the two thoughts you had, grabbing the text, and then the potential numbers in the line.
while ($line=<DATA>) { my @c=($line=~/^(\w+)\t/); my @d=$line =~ /(\d+)/gsm; foreach $e (@d) { print $c[0]," ", $e,"\n"; } } __DATA__ abcd 723-724 abcde 552-554-553 abcdef 756

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found