I am trying to split a string like this:
x^-5 - 3
into a list like this:
[x^-5, -, 3]
The first minus after the ^ must be at the same list index as the x, because it's just the negative exponent. However, I want other minuses, which are not an exponent of anything, to be on their own index.
When splitting by -, obviously my x^-5 gets split into two as well.
So is there any way I can achieve this using RegEx or something like that?
Thanks in advance