Rex Wanted!

source1Tamer
Posts: 91
Joined: Tue Nov 13, 2001 3:49 pm

Rex Wanted!

Post by source1Tamer »

I'm trying to find the Rex expression for:
If there is an "image.gif" string before "asp?item=699124" and no any other "asp?item=xxxxxx" strings in between, where xxxxxx is a number.

An example of valid match is:
sometext<image.gif>sometext<href='asp?item=699124'>

But not:

sometext<image.gif>sometext<href='asp?item=000000'>sometext<href='asp?item=699124'>

is it tricky???
thanks..
source1Tamer
Posts: 91
Joined: Tue Nov 13, 2001 3:49 pm

Rex Wanted!

Post by source1Tamer »

I'm trying to find the Rex expression for:
If there is an "image.gif" string before "asp?item=699124" and no any other "asp?item=xxxxxx" strings in between, where xxxxxx is a number.

An example of valid match is:
sometext<image.gif>sometext<href='asp?item=699124'>

But not:

sometext<image.gif>sometext<href='asp?item=000000'>sometext<href='asp?item=699124'>

is it tricky???
thanks..
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Rex Wanted!

Post by mark »

Here's one way:

image\.gif>[^>]*<=[^<]+>>\Lasp?item=699124

The >> makes it look for that subexpression first. Then it will look backwards to match the remainder.
source1Tamer
Posts: 91
Joined: Tue Nov 13, 2001 3:49 pm

Rex Wanted!

Post by source1Tamer »

Actually this doesn't work cause I might have "Lasp?item=xxxxx" where xxxxx is a another item ID AS a string before "asp?item=699124" ,,,
so let me put it in another way...
I want to get the first occurance of "<TR" before the string "asp?item=699124" .
I've tried :
"<TR+[^<TR]*\L.asp?item=700109\L"
even "<TR+.+\L.asp?item=700109\L" doesn't return anything.
source1Tamer
Posts: 91
Joined: Tue Nov 13, 2001 3:49 pm

Rex Wanted!

Post by source1Tamer »

Note:
In my previous message I forgot to paste the ">>" before "\L.asp?item=700109\L".
so it's:
I've tried :
"<TR+[^<TR]*>>\L.asp?item=700109\L"
"<TR+.+>>\L.asp?item=700109\L"
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Rex Wanted!

Post by mark »

<TR=!<TR*>>\Lasp?item=699124
source1Tamer
Posts: 91
Joined: Tue Nov 13, 2001 3:49 pm

Rex Wanted!

Post by source1Tamer »

Good Job!