Check if a string matches a regex in Bash script Check if a string matches a regex in Bash script shell shell