I am trying to write a regex for the following condition:
Allow to enter up to 1 decimal place and if I start with integer 0; the next has to be decimal otherwise any other number entered will remove the 0(integer)
The regex that I have provided is /(^$)|(^[0-9]+(\.([0-9]{1})?)?$)/
it accepts 1 decimal place but I am unable to achieve the remaining part.
Edit 1
passed numbers --> 1.3
4.5
0.4
Failed numbers ---->
004
If number starts with 0, next character must be a decimal only Eg,
0.5 is a pass
005 is a failed