I read a lot of regex question, but I didn't find this yet..
I want a regex in Java to check whether a string (no limit to length) is a number:
including negative (-4/-123)
including
0including positive (2/123)
excluding
+(+4/+123)excluding leading zero
0(05/000)excluding
.(0.5/.4/1.0)excluding
-0
This is what I have done so far:
^(?-)[1-9]+[0-9]*