I have the following string: "FIELDS--> FIELD1: \r\n FILED2: \r\nSOURCEFIELDS--> KEY1: VALUE1, KEY2: VALUE2, KEY3: VALUE3\r\"
I want would want the following from the above string:
[FIELD1, ]
[FIELD2, ]
[KEY1, VALUE1]
[KEY2, VALUE2]
[KEY3, VALUE3]
So I still want the value if its empty. It will be empty sometimes and other times it won't. Also the amount of fields may vary.
I have tried:
x= 'FIELDS--> FIELD1: \r\n FILED2: \r\nSOURCEFIELDS--> KEY1: VALUE1, KEY2: VALUE2, KEY3: VALUE3\r\n'
x.split(':')