I have this regex that works fine enough for my purposes for identifying emails in CSVs within a directory using grep
on Mac OS X:
grep --no-filename -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" *
I've tried to get this working with sed so that I can replace the emails with [email protected]
:
sed -E -i '' -- 's/\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b/[email protected]/g' *
However, I can't seem to get it to work. Admittedly, sed
and regex are not my strong points. Any ideas?