Solution
Regular expression -
(^[0][1-9]+)|([1-9]\d*)
Test online -
Here[
^].
Examples
12345678 - 12345678
0 - Not mached.
01567 - 01567
0000 - Not matched.
bbbb - Not matched.
1 9999 - Space character is not matched, instead it is taken as two different numbers as "1", "9999".
Note
-> All the test strings are written in left box.
-> All the matched results are written in right box.
-> You can also check, which group got executed for the matched string (in box "Match groups" below the right "Match result" box),
where
Group-1 is
(^[0][1-9]+)
and
Group-2 is
([1-9]\d*)
.
For example - 12345678 is matched by Group-2 and not by Group-1.
Thanks...