http://www.perlmonks.org?node_id=1040550


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.