Test, validate and match regular expressions
Matches individual terms in a polynomial expression for JavaScript, capturing signs, coefficients, variables (x), and exponents. Handles optional leading signs, decimal coefficients with multiplication, and power notation like x^2. Useful for parsing algebraic equations or building math expression solvers.