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

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

Re: Newbie regexp question


From: kgold
Subject: Re: Newbie regexp question
Date: 31 Oct 2002 14:45:36 GMT

Assuming a newbie doesn't want to start writing elisp ...

I do all sorts of repetitive editing like this using a keyboard macro.
Since they use commands you already know (search, cursor movement,
mark, kill), they're easy to create.  And since they execute as
they're being defined, there's less chance for error and debugging
than elisp.

In this case, the macro would be:

isearch-forward-regexp <!--Test-->
beginning-of-line
set-mark-command
isearch-forward-regexp <!--End of Test-->
beginning-of-line
next-line
kill-region

Paul Cohen <paco@enea.se> writes:
> 
> I want to do a Emacs regexp search and replace on a HTML file containing
> patterns like this:
> 
> <!--Test-->
> ...
> <!--End of Test-->
> 
> Where "..." denotes a variable number of lines of HTML text.
> 
> I want to search for all occurrences of the above pattern and then
> remove them from the HTML file!
> 
> I've tried a number of variants without any success. For example the
> following regexp doesn't work:
> 
> <!--Test-->\(.*\n\)*<!--End of Test-->

-- 
-- 
Ken Goldman   kgold@watson.ibm.com   914-784-7646


reply via email to

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