I created this regex to match all integers and floats in polynomials.
This regex MATCHES:
All of the above + " not followed by "
GROUPS returned:
Note:
so be careful when dealing with the order of the groups returned. In many languages it returns undefined/null, anyway just keep in mind that the order of the groups is SIGN, INT, FLOAT.
Probably I'll create another version where it doesn't matter if the number returned int or float, but I think I'll leave it as it is because it's more precise.