Oh, I get it now.

This isn't tested, but you could try to use greedy matching to your
advantage:

rereplacenocase(string, "^(.*)<table.*?substring.*?</table>", "\1");

Theoretically, that should work.  Let me know, eh?

--Ben

Pascal Peters wrote:

> I have
>
> <table ... >
> [more stuff here]
> mystring
> [more stuff here]
> </table>
>
> in an html file that contains a lot of tables.
> I need to match only the table that contains the string "mystring".
> There are no nested tables in that table.
> "mystring" is unique in the file.
>
> I forgot to write "opening" and "closing" table tag in my original post.
>
>  > -----Original Message-----
>  > From: Ben Doom [mailto:[EMAIL PROTECTED]
>  > Sent: dinsdag 18 mei 2004 17:00
>  > To: CF-RegEx
>  > Subject: Re: Finding a table
>  >
>  > > replaced everything from the first table tag until the one
>  > following
>  > > the string (as it should).
>  > > I need to replace everything from the table tag preceeding
>  > the string
>  > > until the one following the string.
>  >
>  > Huh?  Are you wanting to match the beginning of the next table, too?
>  >
>  > If so, try:
>  >
>  > <table.+?string.+?</table>.*?<table[^>]*>
>  >
>  > for your regex.
>  >
>  > If that's not what you're trying to do, please clarify the problem.
>  >
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to