In Bash, the expression [[ $foo =~ regex ]] returns exit status 0 when the pattern is not found anywhere in the value o…