(self, pattern, data, patternIndex, startIndex=0)
return "%s%s%s%s" % (leftData,
                             match.group(1),
                             placeholder, match.groups()[-1]), True, 0
Check if the line fits the pattern, create the necessary
        elements, add it to stashed_nodes.

        Keyword arguments:

        * data: the text to be processed
        * pattern: the pattern to be checked
        * patternIndex: index of current pattern
        * startIndex: string index, from which we start searching

        Returns: String with placeholders instead of ElementTree elements.
Check if the line fits the pattern, create the necessary
        elements, add it to stashed_nodes.
Check if the line fits the pattern create the necessary elements add it to stashed_nodes .
def __applyPattern(self, pattern, data, patternIndex, startIndex=0):
        """
        Check if the line fits the pattern, create the necessary
        elements, add it to stashed_nodes.

        Keyword arguments:

        * data: the text to be processed
        * pattern: the pattern to be checked
        * patternIndex: index of current pattern
        * startIndex: string index, from which we start searching

        Returns: String with placeholders instead of ElementTree elements.

        """
        match = pattern.getCompiledRegExp().match(data[startIndex:])
        leftData = data[:startIndex]

        if not match:
            return data, False, 0

        node = pattern.handleMatch(match)

        if node is None:
            return data, True, len(leftData)+match.span(len(match.groups()))[0]

        if not isString(node):
            if not isinstance(node.text, util.AtomicString):
                # We need to process current node too
                for child in [node] + node.getchildren():
                    if not isString(node):
                        if child.text: 
                            child.text = self.__handleInline(child.text,
                                                            patternIndex + 1)
                        if child.tail:
                            child.tail = self.__handleInline(child.tail,
                                                            patternIndex)

        placeholder = self.__stashNode(node, pattern.type())

        return "%s%s%s%s" % (leftData,
                             match.group(1),
                             placeholder, match.groups()[-1]), True, 0
def __applyPattern ( self , pattern , data , patternIndex , startIndex = 0 ) : match = pattern . getCompiledRegExp ( ) . match ( data [ startIndex : ] ) leftData = data [ : startIndex ] if not match : return data , False , 0 node = pattern . handleMatch ( match ) if node is None : return data , True , len ( leftData ) + match . span ( len ( match . groups ( ) ) ) [ 0 ] if not isString ( node ) : if not isinstance ( node . text , util . AtomicString ) : # We need to process current node too for child in [ node ] + node . getchildren ( ) : if not isString ( node ) : if child . text : child . text = self . __handleInline ( child . text , patternIndex + 1 ) if child . tail : child . tail = self . __handleInline ( child . tail , patternIndex ) placeholder = self . __stashNode ( node , pattern . type ( ) ) return "%s%s%s%s" % ( leftData , match . group ( 1 ) , placeholder , match . groups ( ) [ - 1 ] ) , True , 0