title: Webapp2 extract named parameters from route URL (without the Request, just the URL)
body: <p>I am using a route like the following in my app:</p>
  
  <p><code>Route(r'/thing/&lt;some_id&gt;/foo', handler=ThingFoo, name="thing-foo")</code></p>
  
  <p>This is used to generate a url using <code>uri_for('thing-foo', some_id="something")</code>, which is returned to the user which they store.
  Then, in another request, the user posts the url returned to them previously, where it needs to be parsed.</p>
  
  <p>I would like to extract the <code>&lt;some_id&gt;</code> pattern's value from the url provided in a similar way to how the router does it to pass the value to the RequestHandler's get/post methods, but the documentation on this seems to be lacking.</p>
  
  <p>Is there something like the following?</p>
  
  <pre><code>route, some_id = webapp2.extract_uri(the_url)
  </code></pre>
  
  <p>(Of course I could extract the value directly using a regex, but that doesn't seem very DRY).</p>
  
  <p>Here is an example of what I want to do.</p>
  
  <pre><code>def image_url(request, image_blob_key):
      if image_blob_key:
          return request.url_for('image', resource=image_blob_key, _full=True)
      else:
          return None
  
  def blob_key_from_image_url(image_url):
      # Do something here to calculate the blob_key from the URL.
      return blob_key
  </code></pre>
  
  <p>In one part of my app, image_url is calculated from a blob_key and passed to the user. Later on if they (for example) want to delete the image, they pass the url back in a POST request, and I want to extract the blob_key from it so I can delete it.</p>