regular expression

Hi
In the case expression below,the first condition is if the value is an 8 digit number then do the associated steps.

What i want to know is is there a beter way to write this regular expression?
[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])

i tried [0-9]\{8\} but it didnt work?

 
while [ "$1" != "" ]; do 
case "$1" in 
[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])run_date=$1
shift ;;
-f)reload_monthend=Y
shift;;
*)echo "Invalid Parameters"
exit 1;;
esac

It's not a regex at all, its globbing. It doesn't support things like that.

so what will be the regex for it ?

Perl is better suited for using regular expressions in conditional statements.

regex will be same what you tried..

[0-9]{8}

case statement wont support regex. those are shell's pattern matching (globbing) as Corona688 already told.