Hi, I would like to search through a formula to find if it contains a divide operator.
f= (a + b)/(c - d) e
Below the surface this is build as
f // FullForm
Times[Plus[a,b],Power[Plus[c,Times[-1,d]],-1],e]
I wrongly though that searching for a Divide operation I could use Cases looking for a pattern Power[__,-1] but this doesn't work. I only succeed when converting f in fullform to a string and then use StringCases.
f = f // FullForm // ToString
StringCases[f, __ ~~ "Power[" ~~ __ ~~ ", -1]" ~~ ___]
This returns the expression so I know it found the Divide operation. Basically I would like to search for any +,*,-,/ operator in any formula like above. Is there a way by using the formula itself with Cases?
Thx!