regex - deleting email pattern, keeping the rest using grep, awk or sed? -
regex - deleting email pattern, keeping the rest using grep, awk or sed? -
i got plain text wich want delete email adresses (or replace e). want maintain else in text file. email adresses can followed space, colon, semicolon, question or exclamation mark. work gnuwin , tried grep didn't got right result
grep -eiv "\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}\b" in.txt > out.txt this removes every line containing email pattern. want emails gone.
thank you
for substitution utilize sed not grep:
sed -r 's/\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}\b//ig' in.txt > out.txt regex email sed grep pattern-matching
Comments
Post a Comment