Jan-10-2019, 03:06 PM
People from SO helped a lot:
regex2 = r'\bMACHINE:\s*(?:=.*)?\s*([^<^\n ]+)|$' ​machine = re.findall(regex2, email_body)[0]