JSFiddle - React, Tailwind, and code Playground JavaScript var regExp = new RegExp("(([0-9]+(\.))[0-9]+)+"); console.log(regExp.test('0000'));