I'm trying to extract only emails with top level domains from a file using a bash script. For example: test@email.com or test@email.uk would be picked up but test@email.co.u 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
rep -E -o '[a-zA-Z0-9._-]+@[a-zA-Z0-9_-]+\.[a-zA-Z0-9]{2,}' myfile.html
Comment