title: How do I get the last directory from a URL path using a Zeus rewrite rule?
body: <p>I need a regular expression that will return the last directory in a path.</p>
  
  <p>e.g, from <code>www.domain.com/shop/widgets/</code>, return "widgets".</p>
  
  <p>I have an expression that almost works.</p>
  
  <pre><code>[^/].*/([^/]+)/?$ 
  </code></pre>
  
  <p>It will return "widgets" from <code>www.domain.com/shop/widgets/</code> but not from <code>www.domain.com/widgets/</code></p>
  
  <p>I also need to ignore any URLs that include a filename. So that <code>www.domain.com/shop/widgets/blue_widget.html</code> will not match.</p>
  
  <p>This must be done using regular expressions as it is for the Zeus server request rewrite module.</p>