function isValidNumber(s) { const regex = /^[+-]?((\d+\.?\d*)|(\.\d+))(e[+-]?\d+)?$/i; return regex.test(s); }