title: Configuring urls.py with this regular expression
body: <p>I'm trying to build my first Django-powered blog, but I'm stuck in a point.</p>
  
  <p>I'm trying to grab a permanent link from the URL visited in order to display a single post.</p>
  
  <p>The permanent link I'm using is like that:</p>
  
  <pre><code>http://127.0.0.1:8000/blog/20-feb-2012/a-nice-post/
  </code></pre>
  
  <p>I'd like to grab both the date and the <a href="https://en.wikipedia.org/wiki/Semantic_URL#Slug" rel="nofollow noreferrer">slug</a> from this URL and pass them into a view's function.</p>
  
  <p>I've made this regular expression:</p>
  
  <pre><code>(r'^blog/(?P&lt;day&gt;\d{2})-/(?P&lt;month&gt;\w{3})-/(?P&lt;year&gt;\d{4})/(P?&lt;slug&gt;[-\w]+)/$','blog.views.single_post'),
  </code></pre>
  
  <p>In the urls.py file, but it seems it is not working.</p>
  
  <p>What's wrong with this regular expression?</p>