import re
text = "col1 = 'Test String' , col2= 'Next Test String',col3='Last Text String', col4=37"
pattern = r"([^,\s=]+)\s*=\s*(?:'([^']*)'|(\S+))"
matches = re.findall(pattern, text)
print( dict([(x, z or y) for x,y,z in matches]) )