﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6729	reverse() and {% url %} don't work with slightly-more-advanced regexes	albertpeschar@…	nobody	"This works fine:

{{{
# urls.py
urlpatterns = patters('ads.admanager.view',
    (r'^ad/(?P<id>\d+).html$', 'ad'),
)

# somewhere else (e.g. python manage.py shell)
from django.core.urlresolvers import reverse
url = reverse('ads.admanager.views.ad', kwargs={'id': 123}) # ad/123.html
}}}

Note that the regex used also matches e.g. ad/123xhtml , or any other character because of the ""."" that is not escaped.

----

This doesn't work:

{{{
# urls.py
urlpatterns = patters('ads.admanager.view',
    (r'^ad/(?P<id>\d+)\.html$', 'ad'), # <-- see the escape ( \. )
)

# somewhere else (e.g. python manage.py shell)
from django.core.urlresolvers import reverse
url = reverse('ads.admanager.views.ad', kwargs={'id': 123}) # ad/123\.html or ad/123%5C.html
}}}

----

'''Expected:''' ad/123.html[[BR]]
'''Got:''' ad/123\.html[[BR]]

And, '''yes''', I used the SVN version ;-)"		closed	Core (Other)	dev		duplicate	url dispatcher reverse regex		Unreviewed	0	0	0	0	0	0
