#!/bin/bash
declare -a arr=("/test/path/test file with spaces.__1"
"/test/path/test file with spaces.ses"
"/test/path/test file with spaces"
"/test/path/test file with spaces.txt")
# true false false true
PATTERN_STR='(/[^/.]+|\.ses)$'
for FILE_NAME in "${arr[@]}"; do
  if ! [[ "$FILE_NAME" =~ $PATTERN_STR ]]; then
    Match_Result="true"
  else
    Match_Result="false"
  fi
  echo $Match_Result
done;

