Try this here
^(?:[1-9]\d*|0)?(?:\.\d+)?$
See it here online on Regexr
If matching the empty string is not wanted, then you can add a length check to your regex like
^(?=.+)(?:[1-9]\d*|0)?(?:\.\d+)?$
The positive lookahead (?=.+) ensures that there is at least 1 character