Good tutorial + reference for Emacs search and rep

2019-07-02 00:32发布

问题:

For a new user of Emacs, are the any good tutorials + references for learning and getting familiar with Emacs's search, replace and regex features?

回答1:

In Emacs, press C-h r to go to the manual and look at the section on Searching and Replacement. That'll cover everything you need, I think.



回答2:

There are a lot of good resources online for how to do this. A cursory search uncovered:

EmacsWiki and more specifically: EmacsWiki Regular Expressions.

A good Emacs tutorial can be found at: A guided tour of Emacs.

If you have specific examples that are not working as you expect, let's see what you are doing.



回答3:

You should take a look at A guided tour of Emacs, since it contains a pretty good crash-course in search-replace a bit down. Look for the heading Regular expression search and replacement :-)



回答4:

I've found this blogpost usefull: http://psung.blogspot.com/2009/12/subtleties-of-search-and-replace-in.html.



回答5:

There are many ways to search and replace in Emacs. The Emacs Wiki page on CategorySearchAndReplace has a good summary of links to pages that cover different search and replace options, including:

  1. Search in Buffers
  2. Replace in Buffers
  3. Search Across Files
  4. Replace Across Files

Drill down from that page to the search/replace topics of interest.