i want to extract an equation constants(i.e integer or double NOT followed by a letter like say "x") from a string.
e.g eqn = "30.14x^2 + 55.69x + 60.1 = 100".
So far, i can get the coefficients of x using
([\\+\\-])?(\\d+(\\.\\d+)?)x
which gives 55.69x or 30.14x in this case.
Now i want to get the constants and I've tried regex below to extract +60.1 or 100
(?<!^)([\\+\\-])?(\\d+(\\.\\d+)?)(?!x)
However this doesn't work.Any help would be highly appreciated since I've on this for a month or so.