in reply to Adapting parenthesis in regexps

Or, you can just skip the use of split all together...
my %bits = $string =~ /([^=]+)=<?(.+?)>?\s*(?:,\s*|$)/g;
Edit: added clause to grab last pair

Replies are listed 'Best First'.
Re^2: Adapting parenthesis in regexps
by Ionitor (Scribe) on Mar 29, 2007 at 13:55 UTC
    And, because I'm always looking to practice my regex-fu, here's a version with all greedy matches, which tend to be faster--I timed a roughly 40% speed increase.
    my %bits = $string =~ / ([^=]+) # Key =<? # Seperator ([^,>]+ (?> >[^,>]+)*) # Value >?(?:,\s*|\s*$) # Termination /gx;