Remove exact matching word using sed [closed]
In the above string, you don't need start-of-word/end-of-word markers and you may use:
echo 'foggy light' | sed 's/foggy//g'
For the additional question in the comment:
Indeeed, my sed version
sed --version
sed (GNU sed) 4.2.2
supports the Syntax with \<...\>
echo 'foggy foggylight' | sed 's/\<foggy\>//g'
foggylight
If it doesn't work for you, report your sed version and read its manpage. For my sed, this syntax works too:
echo 'foggy foggylight' | sed 's/\bfoggy\b//g'
foggylight
\b
can be memorized as boundary.