I'm trying to replace some uppercase bbcode tags to lowercase like this:
p=re.compile(r'\[URL="(.*?)"\](.*?)\[/URL\]',re.S+re.I)
message=p.sub('[url=\\1]\\2[/url]',message)
But i need to replace massive tags so I'm not doing a compile for each. If i use a [(.*?)] the sub will replace with same uppercased anyway.
So the question is:
How to replace and lowercase 2 or more groups using RE in Python