I am trying to validate a text box and I want the user to only enter between 0.1 and 4.0 and i am using the following regex
^[0-4](\.[0-9]+)?$
the Thing is that is is even accepting 4.1 and so on until 4.9
Any ideas please on how I can fix this
Thanks
Try this
EDIT
I added non capturing groups.
And as CyprUS asked, here an explanation:
I limited the original regex to go up to 3.9 and added another condition for 4(.0)