Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed a case of incorrect parsing of quanitifers in reg-exp patterns.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a9465a75de3d233df1a5e03b35835590369b1a30 1 parent eefec15
Malcolm Tredinnick authored September 01, 2008
1  django/utils/regex_helper.py
@@ -248,6 +248,7 @@ def get_quantifier(ch, input_iter):
248 248
     while ch != '}':
249 249
         ch, escaped = input_iter.next()
250 250
         quant.append(ch)
  251
+    quant = quant[:-1]
251 252
     values = ''.join(quant).split(',')
252 253
 
253 254
     # Consume the trailing '?', if necessary.
1  tests/regressiontests/urlpatterns_reverse/tests.py
@@ -50,6 +50,7 @@
50 50
     ('mixed', '/john/0/', [], {'name': 'john'}),
51 51
     ('repeats', '/repeats/a/', [], {}),
52 52
     ('repeats2', '/repeats/aa/', [], {}),
  53
+    ('repeats3', '/repeats/aa/', [], {}),
53 54
     ('insensitive', '/CaseInsensitive/fred', ['fred'], {}),
54 55
     ('test', '/test/1', [], {}),
55 56
     ('test2', '/test/2', [], {}),
1  tests/regressiontests/urlpatterns_reverse/urls.py
@@ -35,6 +35,7 @@
35 35
     url(r'^(?P<name>.+)/\d+/$', empty_view, name="mixed"),
36 36
     url(r'^repeats/a{1,2}/$', empty_view, name="repeats"),
37 37
     url(r'^repeats/a{2,4}/$', empty_view, name="repeats2"),
  38
+    url(r'^repeats/a{2}/$', empty_view, name="repeats3"),
38 39
     url(r'^(?i)CaseInsensitive/(\w+)', empty_view, name="insensitive"),
39 40
     url(r'^test/1/?', empty_view, name="test"),
40 41
     url(r'^(?i)test/2/?$', empty_view, name="test2"),

0 notes on commit a9465a7

Please sign in to comment.
Something went wrong with that request. Please try again.