A classe de caracteres Posix deve ser especificada como [[:digit:]]
:
[[ $hostname =~ star0[[:digit:]] ]] && echo ok
A abordagem simplificada alternativa seria:
[[ $hostname =~ star0[0-9] ]] && echo ok
[:digit:]
is a POSIX character class, used inside a bracket expression like[x-z[:digit:]]
. The POSIX character class names must be written all lowercase.