I setup this patter in url.py
url(r'^events/(?P<year>\d{4})/(?P<month>\d{2})/$', events, name="eventsMonth")
in my template I have this tag
{% url eventsMonth year=month.prev.year month=month.prev.month %}
but I keep getting
Caught NoReverseMatch while rendering: Reverse for 'eventsMonth' with arguments '()' and keyword arguments '{'month': 7, 'year': 2011}' not found.
I traced the problem into the reverse() code and the logic goes all the way to the end, when the following statement from line 325 of core/urlresolvers.py fails and I can't figure out why
if re.search(u'^%s' % pattern, candidate, re.UNICODE):
The pattern is
'events/(?P<year>\\d{4})/(?P<month>\\d{2})/$'
and the candidate is
u'events/2011/7/'
Why doesn't that regular expression match? What am I doing wrong?