As a requirement i need to accept the digits from 0-99 and also the decimal numbers which has 2 digits before (dot) and 14 digits after (dot). Could some one please help me with the regex for this.
examples:
Accepted :
1
12
0
99
1.0
11.0
99.0
99.99999999999999 –> upto (2,14 digits)with dot
Not accepted:
123
100
123.1
- —> (should be rejected without any digit after decimal)
1.123456789012345 (2,15 digits should not be accepted.)
>Solution :
^\d{1,2}(\.\d{1,14})?$
First Matches 1 or 2 digits, then an optional . plus 1 to 14 digits before line end.
See the results here: https://regex101.com/r/ZTWAXh/1