Matching zero only once using RE

Benji York benji at
Fri Oct 7 19:54:38 CEST 2005

GregM wrote:
> I am trying to see if a web page contains the exact text:
> You have found 0 matches

It is unclear to me why you're using a regex at all.  If you want to 
find the *exact* text "You have found 0 matches" perhaps you should do 
something like this:

if "You have found 0 matches" in pagetext:
     print 'yes'
     print 'no'

Benji York

More information about the Python-list mailing list