unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* silly regexp-replace question: how to delete empty lines
@ 2004-03-03  1:11 leo
  2004-03-03  6:25 ` Barry Margolin
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: leo @ 2004-03-03  1:11 UTC (permalink / raw)


hi there

in a buffer like

  text is here
  and here and
  here

  further text is here

  an the endtext

i want to delete the two empty lines by an regexp-replace.

so i started with _finding_ the lines. that's easy: "^$" is the regexp. but
obviouly (replace-regexp "^$" "ghdfg" nil nil nil) does nothing.;-)

SO in order to delete empty lines (i.e. to replace it with "") i have to
find the empty line _plus_ the linefeed.

so i tried (replace-regexp "^$
" "ghdfg" nil nil nil) where the linefeed was type as C-q C-j. but it
doesn't find anything.

any idea?

thanks, leo

^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <200403040341.i243ftF7381474@e1.ny.us.ibm.com>]

end of thread, other threads:[~2004-03-04 10:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-03  1:11 silly regexp-replace question: how to delete empty lines leo
2004-03-03  6:25 ` Barry Margolin
2004-03-03  6:36 ` Sacha Chua
2004-03-03 20:11 ` Peter Lee
2004-03-03 23:53   ` leo
2004-03-04  1:31     ` Johan Bockgård
2004-03-04 10:10       ` Alan Mackenzie
2004-03-03 23:16 ` Joe Fineman
     [not found] <200403040341.i243ftF7381474@e1.ny.us.ibm.com>
2004-03-04  4:07 ` Thomas L Roche

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