Skip to content

Commit

Permalink
Fixed a case of incorrect parsing of quanitifers in reg-exp patterns.
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Sep 1, 2008
1 parent eefec15 commit a9465a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions django/utils/regex_helper.py
Expand Up @@ -248,6 +248,7 @@ def get_quantifier(ch, input_iter):
while ch != '}':
ch, escaped = input_iter.next()
quant.append(ch)
quant = quant[:-1]
values = ''.join(quant).split(',')

# Consume the trailing '?', if necessary.
Expand Down
1 change: 1 addition & 0 deletions tests/regressiontests/urlpatterns_reverse/tests.py
Expand Up @@ -50,6 +50,7 @@
('mixed', '/john/0/', [], {'name': 'john'}),
('repeats', '/repeats/a/', [], {}),
('repeats2', '/repeats/aa/', [], {}),
('repeats3', '/repeats/aa/', [], {}),
('insensitive', '/CaseInsensitive/fred', ['fred'], {}),
('test', '/test/1', [], {}),
('test2', '/test/2', [], {}),
Expand Down
1 change: 1 addition & 0 deletions tests/regressiontests/urlpatterns_reverse/urls.py
Expand Up @@ -35,6 +35,7 @@
url(r'^(?P<name>.+)/\d+/$', empty_view, name="mixed"),
url(r'^repeats/a{1,2}/$', empty_view, name="repeats"),
url(r'^repeats/a{2,4}/$', empty_view, name="repeats2"),
url(r'^repeats/a{2}/$', empty_view, name="repeats3"),
url(r'^(?i)CaseInsensitive/(\w+)', empty_view, name="insensitive"),
url(r'^test/1/?', empty_view, name="test"),
url(r'^(?i)test/2/?$', empty_view, name="test2"),
Expand Down

0 comments on commit a9465a7

Please sign in to comment.