function numberCheck (text) { var regex = /^[+|-]?\d*\.?\d*$/; if (!regex.test(text)){ return false; } return true; }