echo " HELLO x=10" |sed 's/ *\HELLO \+/HELLO /g'
removes continuous space before hello and after word "HELLO"
but this doesn't
echo " WHERE x=10" |sed 's/ *\WHERE \+/WHERE /g'
i have tried to escape \w with \w like below
echo " WHERE x=10" |sed 's/ *\\"WHERE" \+/\"WHERE" /g'
but even this is not working. What is wrong.