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
In reply to Re: In need of a stupid regex trick
by Zaxo
in thread In need of a stupid regex trick
by 87C751
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |