>Wesley Darlington <[EMAIL PROTECTED]> wrote:
>> -p s/\s*("([^"]*)"|((\S*?)#.*)|(\S+))\s*/$2$4$5:/g,s/:+$/\n/
>
>That's downright clever. I think the approach could be a winner, but
>as is it removes trailing empty fields:
>x ""
>becomes:
>x
>instead of:
>x:
Now that someone has braved removing the quotes in the regex (which
I was hoping would happen) I'll post my solution that does it the
long way:
82:
-nl $,=":";print map/^"(.*)"$/?$1:$_,/\s*("[^"]*"(?=[\s#]|$)|[^\s#]+)\s*(?:#.*)?/g
This should be easily beatable.