in reply to Re: Help with regex for complicated key=value string
in thread Help with regex for complicated key=value string

Point 2 can be done with:
split /(?:^|[^\\])(?:\\\\)*\K,/ # 5.10 required
But that's just point 2, it doesn't consider commas inside quotes.

Replies are listed 'Best First'.
Re^3: Help with regex for complicated key=value string
by ikegami (Patriarch) on Oct 29, 2008 at 19:09 UTC
    That would be:
    split /(?:$key_pat=)?$val_pat\K,/

    Using split means everything has to be parsed twice. Once to find the commas on which to split and once to find the composing terms.

    Update: Simplified pattern slightly.

    A reply falls below the community's threshold of quality. You may see it by logging in.