Hi,
I've looked at a lot of pages on the net and still can't seem to nail
this. Would someone more knowledgeable in regular expressions please
provide some help to point out what I'm doing wrong?
I am trying to see if a web page contains the exact text:
You have found 0 matches
But instead I seem to be matching all sorts of expected line like
You have found <a number up to 5 digits long with comma> matches
for example:
You have found 34 matches
You have found 189 matches
You have found 16,734 matches
You have found 1,706 matches
You have found 300 matches
The last 2 I thought I had eliminated but sadly it seems not the
examples above actually seem to match my expression below. :(
Here is what I'm doing:
zeromatch = []
SecondarySearch Term = 'You found (0){1} matches'
primarySearchTe rm = 'Looking for Something'
primarySearchTe rm2 = 'has been an error connecting'
# pagetext is all the body text on a web page.
# I'm using COM to drive MSIE and pagetext = doc.body.outerT ext
if (re.search(prim arySearchTerm, pagetext) or
re.search(prima rySearchTerm2, pagetext)):
failedlinks.app end(link)
elif (re.search(Seco ndarySearchTerm , pagetext)):
zeromatch.appen d(link)
I've tried other RE's be had even more spectacular failures any help
would be greatly appreciated.
Thanks in Advance,
Greg Moore
Software Test
Shop.com
I've looked at a lot of pages on the net and still can't seem to nail
this. Would someone more knowledgeable in regular expressions please
provide some help to point out what I'm doing wrong?
I am trying to see if a web page contains the exact text:
You have found 0 matches
But instead I seem to be matching all sorts of expected line like
You have found <a number up to 5 digits long with comma> matches
for example:
You have found 34 matches
You have found 189 matches
You have found 16,734 matches
You have found 1,706 matches
You have found 300 matches
The last 2 I thought I had eliminated but sadly it seems not the
examples above actually seem to match my expression below. :(
Here is what I'm doing:
zeromatch = []
SecondarySearch Term = 'You found (0){1} matches'
primarySearchTe rm = 'Looking for Something'
primarySearchTe rm2 = 'has been an error connecting'
# pagetext is all the body text on a web page.
# I'm using COM to drive MSIE and pagetext = doc.body.outerT ext
if (re.search(prim arySearchTerm, pagetext) or
re.search(prima rySearchTerm2, pagetext)):
failedlinks.app end(link)
elif (re.search(Seco ndarySearchTerm , pagetext)):
zeromatch.appen d(link)
I've tried other RE's be had even more spectacular failures any help
would be greatly appreciated.
Thanks in Advance,
Greg Moore
Software Test
Shop.com
Comment