title: how to explode an url in javascript
body: <p>I would like to remove "/first" string and remove _1_1_1 at the end of the url.</p>
  
  <pre><code>/foo/blah/tree/first/image_pack-1-1-1
  </code></pre>
  
  <p>what i need to turn  is </p>
  
  <pre><code>/foo/blah/tree/image_pack
  </code></pre>
  
  <p>Here's what I have done but doesn't work as i wish. I'm stuck at some point.</p>
  
  <pre><code>var fileUrl = "/foo/blah/tree/first/image_pack-1-1-1";
  var output = fileUrl.split(/[/ ]+/).pop();
  var explode = output.split("-");
  console.log(explode[0]);
  </code></pre>