Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 musing on the Monastery: (17)
As of 2014-07-24 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (165 votes), past polls