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
If you want the other version where you don't matter if the number is int or float, then check this out ->