Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to search for newline in text file using emacs [duplicate]

I am looking for a particular pattern using the ctrl+s search feature in emacs.

I am looking for 0,0,0 "newline"

Basically, there are lots of rows, some have 0,0,0 inside the middle of the row, but I want to specifically search for lines ending in 0,0,0 so I would like to add a newline at the end of the search string.

How do I do this in emacs?

like image 302
user788171 Avatar asked Nov 25 '13 05:11

user788171


1 Answers

You can input special characters by appending a C-q (isearch-quote-char, in isearch mode, that sort of mimics quoted-insert, default binding for that key combo in other modes).

So, in your case, you should use: C-s 0,0,0 C-q C-j, since C-q C-j inserts a newline.

like image 197
juanleon Avatar answered Sep 20 '22 23:09

juanleon