How to grab a number from inside a .html file using regex

Νίκος nikos.the.gr33k at gmail.com
Sat Aug 7 21:36:27 CEST 2010


On 7 Αύγ, 22:07, MRAB <pyt... at mrabarnett.plus.com> wrote:

> re.search('cyta', host) will return None if there's no match, but you
> said "Yes it does contain it", so there _is_ a match, therefore:
>
>      hostmatch is None
>
> is False.

The code block inside the if structure must be executes ONLY if the
'visitor' cookie is not set to the client's browser or the hostname
address of the client doesn't contain in it the string 'cyta'.

# ======================================
# do not increment the counter if a Cookie is set to the visitors
browser already
# ======================================

if cookie.has_key('visitor') != 'nikos' or re.search('cyta', host) is
None:

I still don't get it :)



More information about the Python-list mailing list