numeric string and length

given a string passed to a program that supposed to be numeric and of a certain length say 8 digits - so say for e.g. need to verify this 01234567
How would I parse this string to validat it meet requirements

I tried to use * | sed /\([1-9]\{8})/

Thanks in advance

If your shell support parameter expansion

NR=01234567
[ ${#NR} -eq 8 -o "${NR//[0-9]/}"!="" ] && echo NOK  || echo OK