fork download
  1. import re
  2. p = re.compile(r'[\w.-]+@(?![\w.-]*\.(?:png|jpe?g|gif)\b)[\w.-]+\b')
  3. test_str = "{'email': ['billy666@stanford.edu',\n 'cantorfamilies@stanford.edu',\n 'cantorfamilies@stanford.edu',\n 'cantorfamilies@stanford.edu',\n 'footer-stanford-logo@2x.png']}"
  4. print(set(p.findall(test_str)))
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
set(['cantorfamilies@stanford.edu', 'billy666@stanford.edu'])