Hey there.. i read through the regex article, but it didnt quite answer what I am looking for.
say i have the string 5x²-18x+13
i need to get it so that it splits all the coefficients into an array
[0] => 5
[1] => -18
[2] => 13
like that
while if the expression is like -x²-13
it puts an array like
[0] => -1
[1] => 0
[2] => -13
it needs to accept any possibility of the form.. like x² would return
[0] => 1
[1] => 0
[2] => 0
how would you go about doing this? i though preg replace.. but is there a better way?