I have checked the below link for regular expression
Regex to match 2 digits, optional decimal, two digits
regular expression should accept whole number or decimal points. max length should be 10 numbers before decimal and 4 digits after decimal.
tried this below code from above link (2 digit decimal point)
\d{0,2}(\.\d{1,2})?
var patt =new RegExp("\d{0,2}(\.\d{1,2})?")
undefined
patt.test(1)
true
patt.test(1.1)
true
patt.test(11)
true
patt.test(111.111)
true
for 3 digits after decimal also it is giving true value, which is invalid.