minibuffer

How to replace regexp in buffers in Emacs Lisp?

September 05, 2023
(replace-regexp "foo" "XXX")
(while (re-search-forward "foo" nil t)
  (replace-match "XXX"))