

Task

   match a string against a regular expression
   substitute part of a string using a regular expression


s="I am a string"
if [[ $s =~ str..g$ ]]; then
    echo "the string ends with 'str..g'"
fi