Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
169
rated 0 times [  172] [ 3]  / answers: 1 / hits: 16478  / 13 Years ago, thu, march 1, 2012, 12:00:00

I use this to test for digits



/^d+$/


But I need to make sure that it's greater than zero, while still allowing 0000123123123 for instance.


More From » regex

 Answers
166

You can write:



/^d*[1-9]d*$/


(zero or more digits, followed by a nonzero digit, followed by zero or more digits).


[#87098] Thursday, March 1, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aricl

Total Points: 215
Total Questions: 91
Total Answers: 94

Location: Venezuela
Member since Thu, Jul 15, 2021
3 Years ago
aricl questions
Mon, Aug 2, 21, 00:00, 3 Years ago
Mon, Aug 3, 20, 00:00, 4 Years ago
Thu, Feb 13, 20, 00:00, 4 Years ago
Wed, Oct 23, 19, 00:00, 5 Years ago
;