title: Remove up to last backslash from URL using sed
body: <p>I have a list of URLs in a .txt file that end with a filename - I need to extract that filename. However, the number of backslashes and the strings before each backslash differ across URLs, e.g:</p>
  
  <pre><code>https://www.something.com/something/somethingelse/file.zip
  https://www.something.com/something/somethingelse/somethingnew/file2.txt
  </code></pre>
  
  <p>In my URLs, both <code>somethingelse</code> and <code>somethingnew</code> are constants (cannot share actual URLs due to data privacy agreement), but may change in the future. The following code works for the first url, but not the second:</p>
  
  <pre><code>sed 's/^.*\/somethingelse\///g' in_file.txt &gt; out_file.txt
  </code></pre>
  
  <p>Is there a <code>sed</code> pattern I can use to match everything after the last backslash - therefore not requiring a string constant?</p>