in reply to In need of a stupid regex trick
Here's a regex that almost works, but it leaves empty shards. Hence, grep...
It works for your data, but I suspect it is very fragile.local $_= q(one "two three" four five "six seven eight" nine); my @foo = grep {$_} /\G(?:(\w+)\s*)|(?:"([^"]*)"\s*)/g; local $,="\n"; print @foo, $/;
After Compline,
Zaxo
|
|---|