shibly shibly - 9 months ago 33
Python Question

How can I set a url that takes one parameter with aphanumeric string?

What I'm trying to do:

url(r'^confirmemail/[a-bA-z0-9]+/', 'blog.views.confirmemail'),

The exact url would be something like that: or

The length of the string parameter would be ten(10).

How can write that url in


url(r'^confirmemail/(?P<code>[a-zA-Z0-9]+)/', 'blog.views.confirmemail'),


url(r'^confirmemail/(?P<code>[a-zA-Z0-9]{10})/', 'blog.views.confirmemail'), to restrict length to the 10 symbols.