'Instead of $1 that is used by Javascript,
Python uses .'

def convert_to_python(self, matching, replacement):

    new_matching = matching.replace(')?', '|)')
    new_replacement = re.sub('\\$(\\d)', '\\\\g<\\1>', replacement)
    return (new_matching, new_replacement)
