I have a code below
with open(\'file1\',\'r\') as fin: for line in fin: l=line[-5:] l2=re.sub(\'^.*\\((.*?)\\)[^\\(]*$\',\'\\g<1>\',lin