When using re.sub() part of re for python, a function can be used for sub if I am not mistaken. To my knowledge it passes in the match to whatever function is passed for example:
r = re.compile(r'([A-Za-z]')
r.sub(function,string)
Is there a smarter way to have it pass in a second arg other than with a lambda that calls a method?
r.sub(lambda x: function(x,arg),string)