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

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

[h-e-w] search and replace across lines


From: Lance Johnston
Subject: [h-e-w] search and replace across lines
Date: Thu, 25 Apr 2002 10:09:13 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2

Hi,

I'm wondering how I can do a search and replace across lines in emacs. For example, let's say I have the following text in a file:

 constant_text variable_text
 {
 ...

And I want to turn this into:

 constant_text variable_text
 {
   added_text
   ...

After trying for a while to get this to work, I think this question can be simplified to "How can I search across lines?", as I can't even get a search expression to span lines. I've tried all the obvious search expressions:

 constant_text.*$^{
 constant_text.*$\n{
 etc.

None of which seem to work.

Note that I'd like to simply do this using replace-regexp (i.e. via the minibuffer), but am not totally adverse to using lisp to make this happen.

Any ideas much appreciated.

Thanks,
Lance




reply via email to

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