I am trying to make a regex that only allows positive numbers starting from 1 and up E.g.:
1 // pass 23 // pass 023 // fail 00234 // fail 2340 // pass
So far I have this
"^0[0-9].*$" but this will only allow numbers starting with 0 which I dont want.
So how can I make a regex that only supports positive numbers/integers
What I mean is starting from 1 and up
Regex for a decimal number that doe not start in
0 is as follows:
Note that this regex will match sequences of digits that could not be represented as built-in numeric types in Swift.