all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.