How about using `replace-regexp`, which contains optional arguments for `START` and `END`? To control lazy highlighting while the search is being performed, the variable `query-replace-lazy-highlight` can be customized or let-bound to the desired setting; e.g., `nil` for no lazy highlighting. See also the variables `lazy-highlight-initial-delay` and `lazy-highlight-interval`. <!-- language: lang-lisp --> (defun chikan () "Doc-string." (interactive) (replace-regexp "\\<ichi\\>" "one" nil (point-min) (point-max)) (replace-regexp "\\<ni\\>" "two" nil (point-min) (point-max))) For an answer that deals with regexp matches that excludes surrounding word constituants, see https://stackoverflow.com/a/5941448/2112489 , the text of which is copied hereinbelow for convenience: The regexp `\<foo\>` or `\bfoo\b` matches `foo` only when it's not preceded or followed by a word constituent character ([syntax code](http://www.gnu.org/software/emacs/manual/html_node/emacs/Syntax.html) `w`, usually alphanumerics, so it matches in `foo_bar` but not in `foo1`). Since Emacs 22, the regexp [**`\_<foo_bar\_>`**](http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Backslash.html) matches `foo_bar` only when it's not preceded or followed by a symbol constituent character. A symbol constituent is either a word constituent or a character with syntax `_`. Most programming mode define `_` to be a symbol constituent.