def replace ( self , text ) : for ( pattern , repl ) in self . patterns : text = re . subn ( pattern , repl , text ) [ 0 ] return text
python re sub multiple replacements
Do j / v replacement
def replace(self, text):
        """Do j/v replacement"""
        for (pattern, repl) in self.patterns:
            text = re.subn(pattern, repl, text)[0]
        return text