Is it possible to replace regex like query-replace-regex without asking for each matching ?
Use replace-regexp
(note the absence of the query-
prefix).
But also, note the !
keybinding when running query-replace-regexp
. It will replace all occurences beyond point without further questions.
replace-regexp
(note the lack of thequery-
prefix). Not posting this as an answer since I am not quite sure where you want to go with the second question. Also, note that even withquery-replace-regexp
, you can try it out on a match or two, just to see you got it right, then hit!
and it will do the rest without asking. The keypress,
is very useful in this mode: It replaces, but does not move on, so you can see what happened. – Harald Hanche-Olsen Nov 28 '15 at 8:30s/regexp/replace/options
, using sed would be a solution. – user3593232 Nov 28 '15 at 8:41