import re

s = '\\(2 \\, e^{\\left(2 \\, x\\right)} \\sin\\left(2 \\, x\\right) + 2 \\, e^{\\left(2 \\, x\\right)} \\cos\\left(2 \\, x\\right)\\)'

print(re.sub(r'e\^{\\left\((.*?)\\right\)}', r'e^{\1}', s))

try:
   re.sub(r'(?Pe\^{\\left()(?P.*)(?P\\right)})','e\^{\\g}',s)
except Exception as e:
   print(e)

print(re.sub(r'e\^{\\left\((.*)\\right\)}', r'e^{\1}',s))

