( self, instring, maxMatches=_MAX_INT )
Scan the input string for expression matches.  Each match will return the
           matching tokens, start location, and end location.  May be called with optional
           maxMatches argument, to clip scanning after 'n' matches are found.

           Note that the start and end locations are reported relative to the string
           being parsed.  See L{I{parseString}<parseString>} for more information on parsing
           strings with embedded tabs.
Scan the input string for expression matches.  Each match will return the
           matching tokens, start location, and end location.  May be called with optional
           maxMatches argument, to clip scanning after 'n' matches are found.
Scan the input string for expression matches . Each match will return the matching tokens start location and end location . May be called with optional maxMatches argument to clip scanning after n matches are found .
def scanString( self, instring, maxMatches=_MAX_INT ):
        """Scan the input string for expression matches.  Each match will return the
           matching tokens, start location, and end location.  May be called with optional
           maxMatches argument, to clip scanning after 'n' matches are found.

           Note that the start and end locations are reported relative to the string
           being parsed.  See L{I{parseString}<parseString>} for more information on parsing
           strings with embedded tabs."""
        if not self.streamlined:
            self.streamline()
        for e in self.ignoreExprs:
            e.streamline()

        if not self.keepTabs:
            instring = _ustr(instring).expandtabs()
        instrlen = len(instring)
        loc = 0
        preparseFn = self.preParse
        parseFn = self._parse
        ParserElement.resetCache()
        matches = 0
        try:
            while loc <= instrlen and matches < maxMatches:
                try:
                    preloc = preparseFn( instring, loc )
                    nextLoc,tokens = parseFn( instring, preloc, callPreParse=False )
                except ParseException:
                    loc = preloc+1
                else:
                    matches += 1
                    yield tokens, preloc, nextLoc
                    loc = nextLoc
        except ParseBaseException, pe:
            raise pe
def scanString ( self , instring , maxMatches = _MAX_INT ) : if not self . streamlined : self . streamline ( ) for e in self . ignoreExprs : e . streamline ( ) if not self . keepTabs : instring = _ustr ( instring ) . expandtabs ( ) instrlen = len ( instring ) loc = 0 preparseFn = self . preParse parseFn = self . _parse ParserElement . resetCache ( ) matches = 0 try : while loc <= instrlen and matches < maxMatches : try : preloc = preparseFn ( instring , loc ) nextLoc , tokens = parseFn ( instring , preloc , callPreParse = False ) except ParseException : loc = preloc + 1 else : matches += 1 yield tokens , preloc , nextLoc loc = nextLoc except ParseBaseException , pe : raise pe