I have a regular expression through which I want to replace values with those values minus 10. The re is:
re.compile(r'<stuff[^\>]*translate\((?P<x>\d*),(?P<y>\d*)\)"/>')
I want to replace the x and y groups. To do this, I want to use re.sub
and passing it a function. However, in the function, how can I most easily build a string which is the same as the input, only with the x and y values replaced by themselves minus 10?