all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Cohen <paco@enea.se>
Subject: Re: Newbie regexp question
Date: Wed, 30 Oct 2002 16:46:41 GMT	[thread overview]
Message-ID: <3DC00D40.B76302FD@enea.se> (raw)
In-Reply-To: 8765vkkkko.fsf@fbigm.here

Hi Fridrich,

Friedrich Dominicus wrote:

> 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-->
> I would restate the problem. It does not make much sense to me to
> match over a bunch of lines you do not want to handle.
>
> So how about
> M-C-% ^[ \t]*<!--.*Test.*--> with: RET

No that's not what I want. Let me rephrase in more general terms. I want to
remove a number of character sequences for which the following holds:

1) They run over multiple lines.
2) They begin and end with well defined sequences of characters. (In my case
with "<!--Test-->"  and "<!--End of Test-->"). Let's call the delimiting
character sequences for the start and and end token.
3) They may contain any number of unknown (printable) characters between the
start and end token.
4) There may exist multiple instances of these character sequences in the
file.

/Paul

  reply	other threads:[~2002-10-30 16:46 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 [this message]
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
  -- 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=3DC00D40.B76302FD@enea.se \
    --to=paco@enea.se \
    /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.