emaillist.txt
1. Saman.desilva@tamucc.edu
2. saman_desilva@tamucc.edu
3. saman&desilva@tamucc.edu
4. Saman.desilva@gmail.com
5. saman@desilva@yahoo.com
6. saman@mail@com
7. saman.desilva@yahoo com
I want to print valid email addresses but am having trouble figuring this problem out. So far I have this script, but it doesn't print the fully correct output. It still gives me an incorrect output.
sed -nr '/\w+@\w+\.\w+$/p' emaillist.txt
The output:
saman.desilva@tamucc.edu
saman_desilva@tamucc.edu
saman&desilva@tamucc.edu
Saman.desilva@gmail.com
saman@desilva@yahoo.com