I need a regex that allows UP TO 4 digit number AND/OR 4 decimal places.
ONLY allowed format examples (I'm just using only 1s to make the format looks simple, it all should be [0-9])
1
1.1
1.11
1.111
1.1111
11
11.1
11.11
11.111
11.1111
111
111.1
111.11
111.111
111.1111
1111
1111.1
1111.11
1111.111
1111.1111
So far the closest one I've gotten --
"^[0-9]{0,4}(?:.[0-9]{0,4}$)"
It works pretty good when I enter numbers + decimals. However, if I just enter numbers without decimals, I can enter 4+ number digits, which it should not.