[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: replace and delete
From: |
Kevin Rodgers |
Subject: |
Re: replace and delete |
Date: |
Mon, 10 Nov 2003 09:54:47 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Herbert Fritsch wrote:
First I want to delete empty lines. I don't get it.
M-<
M-x delete-matching-lines RET ^$RET
Second I want to replace/delete words in a line except the beginning of the
line "ABC*:".
If "ABC*:" is literal text, and you want to delete all the text after it:
M-x replace-regexp RET ^\(ABC\*:\).* RET \1 RET
If it's a regular expression, just use * instead of \*.
If you want to replace the text with something else, use \1 something_else
instead of just \1.
--
Kevin Rodgers