let a = '1.2'; var regs=/^(\d+)(\.\d+)?$/; var regs1=/^\d+$/; if(!regs.test(a) || !regs1.test(a)) { console.log(a); }