in reply to How to slice complicated string into an array
my @a; my $s = '"word1",word2,"word3,word4"'; push(@a, $+) while $s =~ m {"([^\"\\]*(?:\\.[^\"\\]*)*)",? | ([^,]+),? | ,}gx; print "|$_|\n" for (@a); [download]