Sublime Forum

Search and replace and regex - matching end line

#1

Hello Folks,

I am using the search and replace feature to look for the end of the line. Using regex this can be easily accomplished using \R. The problem is, when I do put something to replace it for, it is gone and I do not know how to insert it back in the replace field. Please help!

Thank you,

Rom Pereira

0 Likes

#2

Replacing e.g. “ab” (with it’s line ending) with “fg” (ofc with the line ending as well):

Regular Expression: on
Find What: ab\n
Replace With: fg\n

0 Likes

#3

Works! Sweet highend, thank you!

0 Likes

#4

why not using the “$” metacharacter?
for example, replace lines endings with ab to endings with cd
try
following

Regular Expression: on
Find What: ab$
Replace With: cd

0 Likes