An additional binary operator, =~, is available, with the same precedence as == and !=. When it is used, the string to the right of the operator is considered an extended regular expression and matched accordingly (as in regex(3)).
So the regular expression matching operator should be
if [[ "$stringZ" =~ ^[[:blank:]][[:blank:]]*$ ]];then
echo string is blank
echo string is not blank
You can reduce the verbosity of the regular expression by using
+ quantifier (meaning previous entity 1 or more times):
if [[ "$stringZ" =~ ^[[:blank:]]+$ ]]; then