Matching zero only once using RE

Benji York benji at benjiyork.com
Fri Oct 7 13:54:38 EDT 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'
else:
     print 'no'

--
Benji York




More information about the Python-list mailing list