Why not just split on /,\s*/ then parse out /([^=]+)=(.*)/?
Update: And as to your question about the empty element, when your split regexp contains capturing parens the matched delimiters are returned as well as the delimited fields.
In reply to Re: Adapting parenthesis in regexps
by Fletch
in thread Adapting parenthesis in regexps
by cyzza
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |