string = 'key1=value1,key2="value2,still_value2"'
key_value_pairs = re.findall('(?:[^\\s,"]|"(?:\\\\.|[^"])*")+', string)
for key_value_pair in key_value_pairs:
    key, value = key_value_pair.split('=')
Extracting key value pairs from string with quotes