import re
text = "Value names:  0 = Something, 1 = Something, else, 4 = A value, 5 = BAD - enough, 6 GOOD, 7 = Ugly,"
pattern = r"(?P<keys>\d+)\s*(?:=\s*)?(?P<values>.*?)(?=\s*(?:,\s*)?(?:\d|\Z))"
for match in re.finditer(pattern, text):
	print(match.groupdict())