(self, m, repl)
return new
Expand replacement text if regular expression.
Expand replacement text if regular expression.
Expand replacement text if regular expression .
def _replace_expand(self, m, repl):
        "Expand replacement text if regular expression."
        if self.engine.isre():
            try:
                new = m.expand(repl)
            except re.error:
                self.engine.report_error(repl, 'Invalid Replace Expression')
                new = None
        else:
            new = repl

        return new
def _replace_expand ( self , m , repl ) : if self . engine . isre ( ) : try : new = m . expand ( repl ) except re . error : self . engine . report_error ( repl , 'Invalid Replace Expression' ) new = None else : new = repl return new