#!/bin/bash # # String comparison with a pattern, using an 'extglob' type pattern # str="Further ancillary Bash tips - 11" if [[ $str == +([[:alnum:] -]) ]]; then echo "Matched" fi