unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Beginner trouble with regexp matching
@ 2011-10-29 14:22 Marko Vojinovic
  2011-10-29 14:25 ` Jai Dayal
  0 siblings, 1 reply; 4+ messages in thread
From: Marko Vojinovic @ 2011-10-29 14:22 UTC (permalink / raw)
  To: help-gnu-emacs


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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-29 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-29 14:22 Beginner trouble with regexp matching Marko Vojinovic
2011-10-29 14:25 ` Jai Dayal
2011-10-29 14:41   ` Marko Vojinovic
2011-10-29 15:00     ` Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).