3 ms·
> unix wizards will tell me a better way of doing this Great story. I won't claim to be a wizard, but here's mine: grep -Eo "mailto:[^\"']*" webpage.html
by Pete_D 7y ago
> unix wizards will tell me a better way of doing this
Great story. I won't claim to be a wizard, but here's mine:
grep -Eo "mailto:[^\"']*" webpage.html | sed 's/^mailto://' | sort -u
The pattern means "mailto: and then everything up to a single or double quote", and the -o flag means "only show the matches". The main benefit of this approach is that it works even if you have multiple email addresses on a line.
- malux85 7y agoYou are a wizard, today I learn, thank you!