all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kgold@watson.ibm.com (kgold)
Subject: Re: Newbie regexp question
Date: 31 Oct 2002 14:45:36 GMT	[thread overview]
Message-ID: <aprfmg$9ue$1@news.btv.ibm.com> (raw)
In-Reply-To: 3DBFF5F8.B78A64CA@enea.se


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

  parent reply	other threads:[~2002-10-31 14:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-30 15:07 Newbie regexp question Paul Cohen
2002-10-30 15:33 ` Friedrich Dominicus
2002-10-30 16:46   ` Paul Cohen
2002-10-30 17:19     ` Friedrich Dominicus
2002-10-30 17:24     ` Michael Slass
2002-10-30 17:42       ` Friedrich Dominicus
2002-10-30 17:50         ` Michael Slass
2002-10-30 21:37           ` Michael Slass
2002-10-30 16:49   ` Barry Margolin
2002-10-30 18:48   ` Stefan Monnier <foo@acm.com>
2002-10-30 19:29     ` Barry Margolin
2002-10-31 14:45 ` kgold [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-10-30 16:57 Bingham, Jay
2002-10-30 21:12 Bingham, Jay
     [not found] <mailman.1036012442.21874.help-gnu-emacs@gnu.org>
2002-10-31 13:56 ` Paul Cohen
2002-10-31 14:41   ` Friedrich Dominicus
2002-10-31 18:11 Bingham, Jay

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='aprfmg$9ue$1@news.btv.ibm.com' \
    --to=kgold@watson.ibm.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.