Next / Previous / Contents / TCC Help System / NM Tech homepage

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