>> >    -n $,=':';$\=$/;print grep$_,/\G\s*(?:"([^"]*)"(?:\s|$)|([^\s#]+))/g;
>> >    (but what a poor score it gives... :/ )
>> 
>> It gets worse:
>> While whitespace separates fields, the last field could have a comment next.
>
>Ugh, missed that one too.  :)
>
>> And "" is an empty field.  But I think the \G is unnecessary.
>
>I think the \G is necessary because the regex doesn't explicitly match the
>comment.  The \G forces it to stop when it gets to the comment, rather than
>skipping over the # and matching more fields.

Oh, right.  Missed that.  Everything I've tried has actually matched
the comment.

Reply via email to