How to grab a number from inside a .html file using regex
python at mrabarnett.plus.com
Sat Aug 7 20:27:58 CEST 2010
> i also dont know what wrong with this line:
> host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )
> hostmatch = re.search('cyta', host)
> if cookie.has_key('visitor') != 'nikos' or hostmatch is None:
> # do stuff
> the 'stuff' never gets executed, while i ant them to be as long as i
> dont have regex match!
Try printing out repr(host). Does it contain "cyta"?
More information about the Python-list