I am looking to match e-mail addresses in a text document for which I am writing a regex. I have come up with something like this for starters -
((?:[a-zA-Z]+[\w+\.\-]+[\-a-zA-Z]+))[ ]*((?:@|at))[ ]*(?:[a-zA-Z\.]+)
I want to make sure that the end of the e-mail address is a 'edu' or 'com'. How do I do this? I am using Python.
Some sample e-mail addresses from my text document
alice @ so.edu
alice at sm.so.edu
alice @ sm.com
Edit -
I want to make a change to this regex ONLY. My regex fits a few other examples in my data.