in reply to Need to match number other than 1

m/\A (?: [1]\d+ # if it starts with a 1, # it has to be followed by other digits | [023456789]\d* # otherwise one digit can be fine ) \z /x

Note that this matches only non-negative integers, and 01 is matched as well (no idea if that's OK or not, spec is unclear).

Note that you need some kind of anchoring (perhaps to a word boundary), but you don't necessarily need to anchor it to start and beginning of the string.