fork download
  1. import re
  2.  
  3. s = '\\(2 \\, e^{\\left(2 \\, x\\right)} \\sin\\left(2 \\, x\\right) + 2 \\, e^{\\left(2 \\, x\\right)} \\cos\\left(2 \\, x\\right)\\)'
  4. print(re.sub(r'e\^{\\left\((.*?)\\right\)}', r'e^{\1}', s))
Success #stdin #stdout 0.02s 5864KB
stdin
Standard input is empty
stdout
\(2 \, e^{2 \, x} \sin\left(2 \, x\right) + 2 \, e^{2 \, x} \cos\left(2 \, x\right)\)