title: Bash Script Regular Expression Issue
body: <p>I've got the following code and have looked at numerous examples but cannot figure out what I'm doing wrong. I know the regular expression works (see <a href="https://regex101.com/r/cB9hN1/1" rel="nofollow">https://regex101.com/r/cB9hN1/1</a>) - just not in my bash script. It's for a git update hook, but clearly I'm doing something wrong! Here's what I've got:</p>
  
  <pre><code>regex='ref:( |)([D]|[U])([E]|[S])(\d+)';
  string="My commit ref: US2233556"
  
  if [[ $string =~ $regex ]];
    then
      echo "[SUCCESS] Your message contains ref: for a Story or Defect."
      exit 0
  else
      echo "[POLICY] Your message is not formatted correctly. Please include a \"ref: USXXXXX\" or \"ref: DEXXX\" in the commit message."
      exit 1
  fi
  </code></pre>
  
  <p>I'd appreciate any help! Thank you!</p>