Ronald J Kimball <[EMAIL PROTECTED]> wrote:
>Here's my current solution, at 64:
>
>-pl $_=join':',grep defined,/"([^"]*)"(?![^\s#])|([^\s#]+)|#.*/g
>
>Originally I had $_.0 instead of defined, but I realized that that skips
>empty fields, i.e. "".  Is there a shorter way to test for defined?

Not that I can think of.

>BTW, (?=\s|#|$) is shorter than (?=[\s#]|$).

So is (?![^\s#]).  That gets me to 62:

-pl s/\s*("([^"]*)"(?![^\s#])|([^\s#]+))\s*(#.*)?/$2$3:/g,chop

Reply via email to