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

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

Re: [h-e-w] Removing lines that match a pattern


From: Christopher J. White
Subject: Re: [h-e-w] Removing lines that match a pattern
Date: 02 Nov 2001 10:39:53 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "matt" == Moore, Mathew L <address@hidden> writes:

matt> I would like to remove the lines of a (very long) file that start with a
matt> specific pattern.  Do I need to write a lisp function, or does anyone 
know a
matt> way to do it with regexp?

matt> I've tried 

matt>   Replace regexp: SOME HEADER\(.*\) with: 

matt> (just hitting RET after the with), but this only removes the text of the
matt> line, not the line itself.

If I understand you correctly, you need to include the EOL character.
What should work is:

  Replace regexp: ^SOME HEADER\(.*\)^J with:

Note that I added the ^ to the beginniing to match the start of the the line.
In interactive mode, to get ^J, type ^Q^J (thats ctrl-Q ctrl-J)

matt> Unfortunately, I don't know Emacs Lisp, but maybe this is a good time to
matt> start learning?

Always a good time, it'll serve you well.

...cj

-- 
------------------------------------------------------------------------------
 Christopher J. White                                    address@hidden
------------------------------------------------------------------------------ 




reply via email to

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