September 28th, 2005, 10:41 AM
Regular expression only matches once
I have a regular expression for a web page. The pattern matches more than once in a page. If I do:
Only the last pattern that matched is printed out. The presious in the page are not printed.
found = rexTableEntries.search(page)
Who can I change this so that? Some ideas?
September 28th, 2005, 11:39 AM
it only finds the first one and then stops searching
you have to use a while loop and test if the last one == 0 or whatever it is
Those people who think they know everything are a great annoyance to those of us who do.
September 28th, 2005, 04:59 PM
September 29th, 2005, 01:11 AM
findall was that what I'm looking for.
Originally Posted by DevCoach
With the follwing code it works.
Thanks for the quick replies.
matchList = re.findall(rexTableEntries, page)
for curMatch in matchList: