parameters: (self, m, repl)
return_statement: return new
docstring: Expand replacement text if regular expression.
docstring_summary: Expand replacement text if regular expression.
docstring_tokens: Expand replacement text if regular expression .
function: 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
function_tokens: 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