Regex in if

Examples for regex tests in if clause

FOO=abbcd
if [[ "$FOO" =~ [Bb]{1,2} ]];then
    echo "match"
fi