Regular expression matching in BASH (equivalent of =~ in Perl)

In Perl I can write a condition that evaluates a match expression like this:

if ($foo =~ /^bar/) {
do blah blah blah
}

How do I write this in shell? What I need to know is what operator do I use? The '=~' doesn't seem to fit. I've tried different operators, I browsed the man page for bash and I Google'd but I can't seem to figure this out.

Thanks!

Are you sure you are using version 3 or newer of bash?
To see which version you are using, do the following:

echo $BASH_VERSINFO

There is some example code at
Bash Regular Expressions | Linux Journal

If you don't have version 3 of bash, see ":" operator in the expr man page:
expr(1): evaluate expressions - Linux man page

You can also use the "case" statement in bash to do matching, but filename matching rules are used instead of regular expression rules.

regex doesn't support in condition prior to bash3.0.

one way :

found=$(echo $foo | grep '^bar')
if [ "$found" ]; then
 do something
else
 do something else
fi

Thank you.