Logging, scanning, and singleton objects for
Python: logscan.py and singleton.py
36. Scan.match(): Match a specific string
logscan.py
# - - - S c a n . m a t c h
def match ( self, s ):
'''Does the rest of the line start with s?
'''
if (self.line[self.pos:]).startswith ( s ):
return self.pos+len(s)
else:
return None