function parseNumber(obj) { return (obj + "").match(/[+-]?\d+(\.\d+)?(E[+-]?\d+)?/g) || []; } alert(parseNumber("xxx-2.3ee+4ee..... -5e600xx 7.5E10 xx9.1E-3"));