How can ^d+$
be improved to disallow 0
?
EDIT (Make it more concrete):
Examples to allow:
1
30
111
Examples to disallow:
0
00
-22
It doesn't matter if positive numbers with a leading zero are allowed or not (e.g. 022
).
This is for Java JDK Regex implementation.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…