$ cat "

Search and Replace with Unprintable Characters in Emacs


Lately I've found myself doing a lot of search & replace to restructure text. Quite often this involves changing whitespace in some way.

For example, to include a newline character in the text to find, or in the replacement string, you simply enter a newline by using the chord C-q C-j.

Here are a few useful whitespace chords:
Tab: C-q C-i
Linefeed: C-q C-j
Carriage return: C-q C-m

Written by Erik Öjebo 2011-06-10 22:34