I'm looking for a regex check expression to test if a decimal value (x) has the following: 0.0 <= x <= 1.0
Only one decimal place is allowed. How to do it?
thank
Try this, it will check one decimal place instead of other suggested options
^((0\.[0-9]{1})|(1\.0))$
The regular expression will look like this:
^(:?(:?0\.[0-9])|(:?1\.0))$
But why not use a decimal comparison?