Upgraded to Bash4 and found that it is not matching regexes:$ echo $BASH_VERSION4.1.2(1)-release$ [[ 20110228 =~ ^[0-9]{8}$ ]] && echo matchesBut Bash 3.0 is:$ echo $BASH_VERSION3.00.16(1)-release$ [[ 20110228 =~ ^[0-9]{8}$ ]] && echo matchesmatchesWhy might this be? Have I not installed it correctly?
Bash regex matching not working in 4.1
bash;regular expression
Check this answer on SO. Since you are using 3.00 version of bash 3, it might regard your problem. Shortly, starting from 3.2 version, quoting the string argument to the [[ command's =~ operator forces string matching, so the correct pattern for bash 4 should be:$ [[ 20110228 =~ ^[0-9]{8}$ ]] && echo matchesmatches