467,877 Members | 1,278 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

Extracting emails with top level domains from a file

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.uk 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
Nov 25 '20 #1
  • viewed: 1375
Share:
1 Reply
128KB
grep -E "[-_a-zA-Z0-9\.+]+@[-a-zA-Z0-9\.]+" myfile.html
Jan 20 '21 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Aleander | last post: by
3 posts views Thread by code_wrong | last post: by
6 posts views Thread by Amma | last post: by
4 posts views Thread by dexter48 | last post: by
reply views Thread by jack112 | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.