Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: split string using regex

by hdb (Parson)
on Jun 25, 2013 at 07:03 UTC ( #1040550=note: print w/ replies, xml ) Need Help??


in reply to Re^2: split string using regex
in thread split string using regex

Try this:

while( $line =~ /(\w+)=("[^"]+"|\S+)/g ) { print "$1: $2\n"; }

Warning: no guarantees if your string is not well-formed.


Comment on Re^3: split string using regex
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2014-09-01 14:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (13 votes), past polls