unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* gnu regex and newline
@ 2002-11-18 21:09 Peter Lee
  2002-11-18 21:47 ` Barry Margolin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Lee @ 2002-11-18 21:09 UTC (permalink / raw)


Is there a way to search for and replace newlines with emacs using regex?  Been
looking through the documentation and I thought there would be some escape char
like \n or something.

Thanks.

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

* Re: gnu regex and newline
  2002-11-18 21:09 gnu regex and newline Peter Lee
@ 2002-11-18 21:47 ` Barry Margolin
  2002-11-18 22:03 ` Tim Haynes
  2002-11-19 15:59 ` Peter Lee
  2 siblings, 0 replies; 4+ messages in thread
From: Barry Margolin @ 2002-11-18 21:47 UTC (permalink / raw)


In article <uk7javb3k.fsf@swbell.net>, Peter Lee  <pete_lee@swbell.net> wrote:
>Is there a way to search for and replace newlines with emacs using regex?  Been
>looking through the documentation and I thought there would be some escape char
>like \n or something.

No, just put a literal newline in the string, by typing C-q C-j.

-- 
Barry Margolin, barmar@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

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

* Re: gnu regex and newline
  2002-11-18 21:09 gnu regex and newline Peter Lee
  2002-11-18 21:47 ` Barry Margolin
@ 2002-11-18 22:03 ` Tim Haynes
  2002-11-19 15:59 ` Peter Lee
  2 siblings, 0 replies; 4+ messages in thread
From: Tim Haynes @ 2002-11-18 22:03 UTC (permalink / raw)


Peter Lee <pete_lee@swbell.net> writes:

> Is there a way to search for and replace newlines with emacs using regex?
> Been looking through the documentation and I thought there would be some
> escape char like \n or something.

Use C-j - optionally quoted, so:
   M-x replace-regexp stuff C-q C-j stuff RET replacementstuff RET

HTH,

~Tim
-- 
Statistically, most thieves steal           |piglet@stirfried.vegetable.org.uk
from other poor people. Robin Hood stole    |http://spodzone.org.uk/
only from the rich and was a hero.          |
(from <http://www.thegamesjournal.com/>)    |

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

* Re: gnu regex and newline
  2002-11-18 21:09 gnu regex and newline Peter Lee
  2002-11-18 21:47 ` Barry Margolin
  2002-11-18 22:03 ` Tim Haynes
@ 2002-11-19 15:59 ` Peter Lee
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Lee @ 2002-11-19 15:59 UTC (permalink / raw)


Thanks Barry and Tim... just what I was looking for.

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

end of thread, other threads:[~2002-11-19 15:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-18 21:09 gnu regex and newline Peter Lee
2002-11-18 21:47 ` Barry Margolin
2002-11-18 22:03 ` Tim Haynes
2002-11-19 15:59 ` Peter Lee

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).