Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: split string using regex

by hdb (Monsignor)
on Jun 25, 2013 at 07:03 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-20 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found