JSFiddle - React, Tailwind, and code Playground
by chridam
JavaScript
var regex = /^\d+(?:\.\d{0,2})$/;
var numStr = "1,0000,00,000";
if (regex.test(numStr))
alert("Number is valid");
by chridam
var regex = /^\d+(?:\.\d{0,2})$/;
var numStr = "1,0000,00,000";
if (regex.test(numStr))
alert("Number is valid");