The regular expression must meet the criteria below. The number of elements before and after the point can be any. Only 1 point is allowed, and a negative sign is allowed only in the first position. I don't need a comma.
Example:
1
-1
-1.
1.
1.2
-.2
-0.2
000.300
All the above expressions must be true.
So if I break ..
- Optional negative sign in the first place.
- Zero or more digits before the point.
- Point is optional. May reach a maximum once. It can also be a pure integer.
- O or more digits after the dot.
Any help would be appreciated.
Jason source
share