title: Regex to match between last character and string
body: <p>I have a URL that looks as follows...</p>
  
  <blockquote>
    <p>/images/home/img/digits.png</p>
  </blockquote>
  
  <p>I need to use regex or some equivalent to get 'digits' from the URL. I am using regex because the same code will be duplicated and the file names will always be different lengths. </p>
  
  <p>I've tried using regex and I get everything after the first / and before the .png, but I need everything after the last / and and before the .png.</p>
  
  <p>Here is what I've been trying:</p>
  
  <pre><code>(?&lt;=/)(.*)(?=.png)
  </code></pre>