Why must you use the case construct? This smells like homework. If this were a "real world" requirement, case is not required here, an if/else would do the job.
UNIX (and its shells) provides appropriate tools for a myriad of tasks. In this instance, the if/else construct is appropriate.
Try a different example using case if you want to learn how it works - for example having a user answer yes/no to a question and then having case decide what to do based upon the user response.
zazzybob is correct... I think you have to keep in mind case works a bit like grep: it tried to match a variable with given values that means patterns vs conditions
And so what you are trying will not work...
As scrutinizer stated, the point is that [1-9]* is interpreted by the shell as a unix pattern ( matching any string starting with a figure from 1 to 9)
And NOT as a regular expression (matching 0 or more figures that are in the interval from 1 to 9 )
You can easily test it with empty string or strings like "9a" an check whether it matches or not
scrutinizer remines me that when a program runs ,
read each line --> expands meta-characters ---> execute built-in commands
(if steps are wrong or not precise enough , Please ! tell me)
Are those steps related why the case command program running right (precondition is that only integers input) ? Am i right ?