diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py
index 625ec63..d0009cc 100644
a
|
b
|
class RegexURLResolver(LocaleRegexProvider):
|
309 | 309 | if sub_match: |
310 | 310 | sub_match_dict = dict(match.groupdict(), **self.default_kwargs) |
311 | 311 | sub_match_dict.update(sub_match.kwargs) |
312 | | return ResolverMatch(sub_match.func, sub_match.args, sub_match_dict, sub_match.url_name, self.app_name or sub_match.app_name, [self.namespace] + sub_match.namespaces) |
| 312 | return ResolverMatch(sub_match.func, tuple([g for i, g in enumerate(match.groups()) if i + 1 not in match.re.groupindex.values()]) + sub_match.args, sub_match_dict, sub_match.url_name, self.app_name or sub_match.app_name, [self.namespace] + sub_match.namespaces) |
313 | 313 | tried.append([pattern]) |
314 | 314 | raise Resolver404({'tried': tried, 'path': new_path}) |
315 | 315 | raise Resolver404({'path' : path}) |
diff --git a/tests/regressiontests/urlpatterns_reverse/namespace_urls.py b/tests/regressiontests/urlpatterns_reverse/namespace_urls.py
index fa892a4..a342621 100644
a
|
b
|
urlpatterns = patterns('regressiontests.urlpatterns_reverse.views',
|
51 | 51 | |
52 | 52 | (r'^included/', include('regressiontests.urlpatterns_reverse.included_namespace_urls')), |
53 | 53 | (r'^inc(?P<outer>\d+)/', include('regressiontests.urlpatterns_reverse.included_urls', namespace='inc-ns5')), |
| 54 | (r'^inc(?P<outer>\d+)and(\d+)/', include('regressiontests.urlpatterns_reverse.included_urls', namespace='inc-ns5')), |
54 | 55 | |
55 | 56 | (r'^ns-outer/(?P<outer>\d+)/', include('regressiontests.urlpatterns_reverse.included_namespace_urls', namespace='inc-outer')), |
56 | 57 | |
diff --git a/tests/regressiontests/urlpatterns_reverse/tests.py b/tests/regressiontests/urlpatterns_reverse/tests.py
index bb25806..f5f85a5 100644
a
|
b
|
resolve_test_data = (
|
52 | 52 | # Namespaces capturing variables |
53 | 53 | ('/inc70/', 'inner-nothing', None, 'inc-ns5', views.empty_view, tuple(), {'outer': '70'}), |
54 | 54 | ('/inc78/extra/foobar/', 'inner-extra', None, 'inc-ns5', views.empty_view, tuple(), {'outer':'78', 'extra':'foobar'}), |
| 55 | # issue #18494 |
| 56 | ('/inc79and80/extra/foobar/', 'inner-extra', None, 'inc-ns5', views.empty_view, ('80',), {'outer':'79', 'extra':'foobar'}), |
55 | 57 | ) |
56 | 58 | |
57 | 59 | test_data = ( |