This becomes a bit more complicated if you allow the number anywhere in the input and if you allow other characters like operators to touch them. Is that what you want?
Here's a terrible, terrible solution for that problem:
if ($regex($1-,/(^|[^\.\d])0*[1-9]|\.[5-9]/S)) {