my %bits = $string =~ / ([^=]+) # Key =]+ (?> >[^,>]+)*) # Value >?(?:,\s*|\s*$) # Termination /gx;