Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: split string using regex

by hdb (Monsignor)
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040550]
help
Chatterbox?
and all is calm...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2017-10-20 04:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (258 votes). Check out past polls.

    Notices?