I need to parse a string and extract substrings to a variable. The strings are not the same. Examples and expected results:
string 1 (no "NAME" pattern): "RB2 F 27/0/31 0/32, R8 28/31/120 2/0/2"
result 1 (save "as is"): "RB2 F 27/0/31 0/32, R8 28/31/120 2/0/2"
string 2 (comma separated "<key>:<value>" pairs): "TYPE :ABC,NAME: AB.DE,DESC:10/10/5:2,COMMENT: , ID:123"
result 2 (extracted comma separated "<key>=<value>" substrings): "TYPE=ABC","NAME=AB.DE","DESC=10/10/5:2","COMMENT=","ID=123"
string 3: "ID:123, NAME:CDE,DESC:10-10/5:2"
result 3: "ID=123","NAME:CDE","DESC=10-10/5:2"
Playing with "re.compile" and "split" but can't find a regex suitable for all the mentioned examples.