Matching regex for range (1 to 99) integres and xx.xx for decimals

The min-max range that you want to use is not Ok. It can not match 100 as the second and the third digit can not be 0 due to the range 1-9.

It should be [0-9]{0,2} or in short d{0,2}

This pattern [0-9].[0-9] will not match only a after a dot, as the dot is not escaped . So it can match any char except a newline and there is only a single digit after it to match.

To match a digit 1-999:

^(?:[1-9][0-9]{0,2})$

Regex demo

For decimals (which can also start with 0)

^[0-9]+[.,][0-9]+$

Regex demo

Source link