title: Regex- remove last word from URI
body: <p>I've a url <code>http://localhost:3001/courses/new</code>. I need to remove <code>/new</code> from the string.</p>
  <blockquote>
  <p><code>http://localhost:3001/courses</code></p>
  </blockquote>
  <p>Any help would be appreciated !!!</p>