I am trying to replace all occurrences of a whole word on emacs (say foo) using M-x replace-regexp.
The problem is that I don't want to replace occurrences of foo in underscored words such as word_foo_word
If I use \bfoo\b to match foo then it will match the underscored strings; because as I understand emacs considers underscores to be part of word boundaries, which is different to other RegEx systems such as Perl.
What would be the correct way to proceed?