$esc is never used in your code, so that means "\\," is not handled yet.
but without doing strict error-checking like yours
It's not really. It only checks for 'key=,...' (key with no value) and 'v"alu"e' (invalid quoting).
Because only alphanumerical keys are allowed anyway (I didn't mentioned that before, sorry) there is no need to look for escaped '=', etc., i.e. everything which doesn't start with /\s*[\w_]+=/ is taken as a single key-less value.
That's the same strategy I used, but I didn't limit to alphanum chars. To do so, change
/\G ( [^=,]+ ) = /xgc && ( $key = $1 );
to
/\G ( [a-zA-Z0-9]+ ) = /xgc && ( $key = $1 );
In reply to Re^3: Help with regex for complicated key=value string
by ikegami
in thread Help with regex for complicated key=value string
by mscharrer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |