I'm currently working with the regex to only allow users to input digits xxxx.xxx
or xxxx.xx
or xxxx
.
I tried the below code but instead of allowing the 5 digits, it also allows 7 and 8 digits.
(^\d{5}$)|(^\d{4}.\d{2}$|^\d{4}.\d{3}$)
^[0-9]{4}.([0-9]{3}|[0-9]{2}|[0-9]{5})$
Sample output: 1223.345 or 1324.23 or 23564
Advance Thanks!