You can clone with HTTPS or SSH.
import retext1 = "alphanumeric@example.org"text2 = "alphanumeric@long.subdomain.more.subdomain.domain.org" r1 = re.compile(r'[a-zA-Z0-9]+@[a-zA-Z]+\.[a-zA-Z]+(\.[a-zA-Z]+)*') print(r1.match(text1).group())print(r1.match(text2).group()) print("part 2 - compare with and without (?:")r2 = re.compile(r'[a-zA-Z0-9]+@[a-zA-Z]+\.[a-zA-Z]+(?:\.[a-zA-Z]+)*') print(r1.findall(text2))print(r2.findall(text2)) print("part 3 - udacity assignment") def addresses(haystack): emails = re.findall(r'\w+@[a-zA-Z]+\.[a-zA-Z]+(?:\.[a-zA-Z]+)*', haystack) return [re.sub("NOSPAM", "", email) for email in emails] input1 = """louiseNOSPAMaston@germany.de (1814-1871) was an advocate fordemocracy. irmgardNOSPAMkeun@NOSPAMweimar.NOSPAMde (1905-1982) wrote aboutthe early nazi era. rahelNOSPAMvarnhagen@berlin.de was honored with a 1994deutsche bundespost stamp. seti@home is not actually an email address.""" output1 = ['louiseaston@germany.de', 'irmgardkeun@weimar.de', 'rahelvarnhagen@berlin.de'] print addresses(input1) == output1