I am trying to split the string
below:
"8-7+5^2"
Into the following:
["8", "7", "5", "2"]
So I am trying to remove all mathematical operators
. My regex
is below:
expression.split("[+-*/^()]")
But I get an error saying that my regex
has an illegal character range
. Sorry if its a simple mistake because I'm still learning regex
at this point.