title: Extracting part of a string on jenkins pipeline
body: <p>I am having some trouble with the syntax in my pipeline script.</p>
  
  <p>I am trying to capture everything after the last forward slash "/" and before the last period "." in this string git@github.com:project/access-server-pd.git (access-server-pd)</p>
  
  <p><a href="https://stackoverflow.com/questions/19482123/extract-part-of-a-string-using-bash-cut-split">Here</a> (below) is how I would like to set it up</p>
  
  <pre><code>MYVAR="git@github.com:project/access-server-pd.git" 
  
  NAME=${MYVAR%.*}  # retain the part before the colon
  NAME=${NAME##*/}  # retain the part after the last slash
  echo $NAME
  </code></pre>
  
  <p>I have it current set up with triple quotes on the pipeline script:</p>
  
  <pre><code>  stage('Git Clone') {
    MYVAR="$GIT_REPO"
    echo "$MYVAR"
    NAME="""${MYVAR%.*}"""
    echo "$NAME"
  </code></pre>
  
  <p>But I am receiving an unexpected token on "." error. How might I write this so that I can get this to work?</p>
  
  <p>UPDATE: This command does the trick:</p>
  
  <pre><code>echo "git@github.com:project/access-server-pd.git" | sed 's#.*/\([^.]*\).*#\1#'
  </code></pre>
  
  <p>Now I just need to find the proper syntax to create a variable to store that value.</p>