def __call__(self, mo): 
    
    """ This handler will be invoked for each regex match """

    # Count substitutions
    self.count += 1 # Look-up string

    return self[mo.string[mo.start():mo.end()]]
 This handler will be invoked for each regex match 
recipes/Python/81330_Singlepass_Multiple_Replace/recipe-81330.py