Solved
Regex for text entry of number between 0 and 2, using "." as separator
Hi,
I would like to use a "Matches Regex" custom validation to ensure that a text entry is a number between 0 and 2. Decimals should be allowed (but not necessary), but they have to use "." (not ",") as a separator.
I have tried "^[0-2]+.[0-9]$", but there are two problems: 1) the code allows "," as a separator and 2) it does not allow a number without a decimal.
I am new to Regex, so any leads would be much appreciated!
Best answer by Kate
Alright- try the following:
```(^[0-2])|(^[0-2]\\.[0-9]$)```
The only thing I don't like about this one, is it does force a zero. So you can't type ".5" you have to type "0.5". But ignorning that hiccup, all else works as expected :)
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
