help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Beginner trouble with regexp matching


From: Marko Vojinovic
Subject: Beginner trouble with regexp matching
Date: Sat, 29 Oct 2011 15:22:46 +0100
User-agent: KMail/1.13.7 (Linux/2.6.35.14-97.fc14.x86_64; KDE/4.6.5; x86_64; ; )

Hi foks! :-)

Sorry if this question is maybe too trivial, but google wasn't my friend 
today. :-(

I am editing a TeX file, and I want to search for "\begin{equation} " (with the 
blank space at the end and without quotes), and to add the newline at the end 
instead of the blank space. So the obvious way to do it appeared to be to 
perform a regexp replacing from

  \\begin{equation}

(which finishes with a space) to

  \\begin{equation}\n

However, this doesn't work --- Emacs correctly matches the first string, but 
fails to replace it with the second, with an error "Invalid use of `\' in 
replacement text".

This is my very first try to use regular expressions for search&replace, and I 
am still learning. What am I doing wrong?

TIA, :-)
Marko




reply via email to

[Prev in Thread] Current Thread [Next in Thread]