my $str='one "two three" four five "six seven eight" nine'; my @list=grep defined, $str=~/"([^"]*)"|(\S+)/g; print join "\n", @list;