how do i get "sed" to delete everything else but email address.
db dump: someusername ::: kRW...0fPc ::: $2a$10$...aucvkDt86 ::: [email protected]
Does it have to be sed? What about grep? Here's how to use it with the regex you gave:
$ cat dbdump.txt
db dump: someusername ::: kRW...0fPc ::: $2a$10$...aucvkDt86 ::: [email protected]
another line with two e-mail addresses <[email protected]> on it -- [email protected]
$ grep -EiEio '\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b' dbdump.txt
[email protected]
[email protected]
[email protected]
The -o
flag prints only the matching portions, i.e. just the e-mail addresses. -i
makes the matching case insensitive. It even finds multiple e-mail addresses on the same line.
Edit: I couldn't resist the -EiEio
. I suppose grep -Eio
or egrep -io
would also work...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With