You dont have to use a lambda function you can use a normal function as well
For example
Code:
def my_function(match):
length_of_backrefs = len(''.join([match.group(i) for i in range(1, 4)]))
full_string = match.group()
# do something to full string
return substituted_string
And in the regexp list
(re.compile(r'(.*)<br.*?>', re.IGNORECASE), my_function),