Okay,
Try this: ^-?(?!0)[0-9]*\.?\d*$
The (?!) is called the "Nagative Lookahead", it says that the character defined here may not be the next character in the string (so, the 0 in this case). It prevents numbers like -0 or 0123 
Edit:
This still matches 1.0, but I'm not sure how to avoid this. Just asserting the first character after the decimal cannot be a 0 doesn't help, because that would also exclude 1.01
Maybe catch this in your scripting language
if ((int)$num == $num) $num = (int)$num;
to cast it to an integer
Bookmarks