I have the following block of text in a file:
test3.legacy test4.legacy test3 test3.kami
I only want to search for test3
as a whole and replace it with nothing. Unfortunately, all my attempts have removed test3 from test3.legacy
and test3.kami
. I've tried:
sed 's/^test3://g' myfile.txt
sed 's/\btest3\b//g' myfile.txt
sed 's/\<test3\>//g' myfile.txt
without any luck. Any ideas how I can resolve this please?
EDIT: Most attempts have resulted in the following: .legacy test4.legacy .kami