import re

pattern = r"[^=\s,]+=(?:'(?:\\+\.\\+)?([^\s,=']+)'|([^\s,=]+))"

s = "x=0, y=0, width=1920, height=1080, width_mm=531, height_mm=299, name='\\\\\\\\\\\\\\\\.\\\\\\\\DISPLAY4', is_primary=True"

res = [m.group(1) if m.group(1) else m.group(2) for _, m in enumerate(re.finditer(pattern, s), start=1)]
print(res)# your code goes here