Regexp replace all on emacs

useful command:

M-x replace-regexp <RET> regexp <RET> newstring <RET>

Replace every match for regexp with newstring

[1] http://www.gnu.org/software/libtool/manual/emacs/Regexp-Replace.html

Advertisements

2 thoughts on “Regexp replace all on emacs”

  1. Yes but, for interactive use, query-replace-regexp is usually more useful. It’s bound to C-M-% and lets you run through the first couple of hits by hand before hitting “!” to do the rest instantly.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s