Here's the scenario:
import re
if __name__ == '__main__':
s = "s = \"456\";"
ss = re.sub(r'(.*s\s+=\s+").*?(".*)', r"\1123\2", s)
print ss
What I intend to do is to replace '456' with 123, but the result is 'J3";'. I try to print '\112', it turns out to be character 'J'. Thus, is there any method to specify that \1 is the group in regex, not something like a escape character in Python? Thanks in advance.