all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "leo" <halloleo@noospaam.myrealbox.com>
Subject: silly regexp-replace question: how to delete empty lines
Date: Wed, 3 Mar 2004 12:11:08 +1100	[thread overview]
Message-ID: <c23bnr$1u62$1@otis.netspace.net.au> (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

             reply	other threads:[~2004-03-03  1:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-03  1:11 leo [this message]
2004-03-03  6:25 ` silly regexp-replace question: how to delete empty lines 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='c23bnr$1u62$1@otis.netspace.net.au' \
    --to=halloleo@noospaam.myrealbox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.