I need to replace every parenthesis at the end of a string. I use this code:
a = '1 (FR) Product (IT, DE, ES)'
b = re.sub(r' \((.*?)\)',r'', a)
But this will replace every parenthesis in my string. How do I tell python to replace it only if the pattern is at the end of the string?