I'm trying to extract only emails with top level domains from a file using a bash script. For example: [email protected] or [email protected] would be picked up but [email protected] k would not be picked up. This is what I've tried to no avail:
rep -E -o '[a-zA-Z0-9._-]+@[a-zA-Z0-9_-]+\.[a-zA-Z0-9]{2,}' myfile.html