Build, test, and debug regular expressions
Captures individual terms from a polynomial expression, such as '3.5*x^2', '-2x', 'x^3', or '+7'. Each term may include an optional sign, a real-number coefficient (integer or decimal), an optional multiplication asterisk, the variable x or X, and an optional caret exponent. With the global flag, it tokenizes polynomials like '3x^2-2x+1' into their constituent terms, making it useful for parsing and evaluating polynomial math expressions.