I have a string as
pow((sin),(2))(4*x+5)+pow((cos),(3))(4*x+3)/pow((tan),(5))(x)
i need to get it as
pow(sin(4*x+5),2)+pow(cos(4*x+3),3)/pow(tan(x),5)
What i tried was
1)split the expression based on operators(+,-,/,*) between pow into single units.
2)extract expression between last parenthisis
3)Insert the extracted subexpression between first string after pow and first closing parenthis for all the units.
what i tried :-
re="pow((sin),(2))(4*x+5)+pow((cos),(3))(4*x+3)+pow((tan),(5))(x)";
re.split(+);
re.replaceAll("^[()]]{3}","\\(\\)]*\\)");
to be frank i am new to regular expression.