title: Substring of string matching regex in a bash shell
body: <p>In a bash shell, I want to take the take a given string that matches a regex, and then take the part of the string. </p>
  
  <p>For example, given <code>https://github.com/PatrickConway/repo-name.git</code>, I want to extract the <code>repo-name</code> substring. </p>
  
  <p>How would I go about doing this? Should I do this all in a shell script, or is there another way to approach this?</p>