+, -, || *, /, && ^, ==, >=, <=, <, >, !=, sign abs, neg
(1+2)^2
should be the same at ( 1 + 2 ) ^ 2
string.Replace("op", " op ")
to add spaces around all the operators. then use string = Regex.Replace(string, @"[ ]+", @" ")
and string.Trim()
to remove any extra spacing from the function. After that, it should be possible to tokenize the function.
abs(1-3) = 2
abs(neg5) = 5
neg 2 = -2
neg(abs(1-3)) = -2
neg(1-3) = 2