title: regular expression to remove the file name from the full url
body: <p>With this code I will get the full path of the executed script, in this case <code>services.js</code>:</p>
  
  <p><strong>JS</strong></p>
  
  <pre><code>var scripts = document.getElementsByTagName("script"),
  src = scripts[scripts.length-1].src;
  
  alert(src); 
  </code></pre>
  
  <p>Output example:</p>
  
  <pre><code>file:///C:/Users/fel/Desktop/currencies-gh-pages/js/services.js
  </code></pre>
  
  <p>But i want an output like this:</p>
  
  <pre><code>file:///C:/Users/fel/Desktop/currencies-gh-pages/js/
  </code></pre>
  
  <p>Any idea?</p>