For isnum, and I don't know why you put "1-", you could simply use: if ($2 isnum).
maybe because he wants to ensure $2 is positive? i mean, that much is obvious, but i can't see what else there is to be confused about.
also, i don't understand how you could use the phrase 'you could simply' and then include this in the same post
if ($regex(%n,/(.){ $+ $2 $+ }/)) {