How to search for a new line in a text file using emacs

I am looking for a specific template using the ctrl + s search function in emacs.

I am looking for 0,0,0 "new line"

Basically, there are many lines, some of which are 0,0,0 inside the middle of the line, but I want to specifically search for lines ending in 0,0,0, so I would like to add a new line at the end of the search line.

How to do it in emacs?

+4
source share
3 answers

You can enter special characters by adding Cq ( isearch-quote-char, in isearch mode, this kind of mimics quoted-insert, the default binding for this key combination in other modes).

, : C-s 0,0,0 C-q C-j, C-q C-j .

+9

- regexp isearch. C-M-s C-s 0,0,0$. ($ - .)

+3

@juanleon @legoscia , . , .

: , ( , C-j)?

If you are going to replace the found matching text, for example, do you want to replace the newline character too, or do you want to replace only the corresponding text at the end of the line, that is, the text before the new line char? If the latter then completes your match pattern with $. If the first one completes your match pattern with C-j(new char string).

+2
source

All Articles