﻿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
2977	Better handling of regular expressions for reverse urlresolver	Chris Beaven	Malcolm Tredinnick	"I spent a bit of time looking over the urlresolvers.py today. I put together a patch fixing some problems with it.

Firstly, regular expressions should be set up outside the function so they only have to be compiled once ('''fix 1''').


A `TODO:` was to make the resolver handle recursive parenthesis. After a bit of thinking (and actually making it work like that) I realised that is actually not what you'd need to do. Recursion is not necessary because the outermost matched parenthesis will be replaced with the given argument anyway.

What ''was'' needed was a rethink of choosing between named/unnamed groups. It should be named groups only (if any exist) for each whole regular expression ('''fix 2''').

It does need to handle non-grouping parenthesis recursively though ('''fix 3''').

Other expression extension notations (apart from named groups, of course) should be ignored ('''fix 4''').

Probably rarely needed, but it now also handles pipes in regular expressions ('''fix 5''').

"	enhancement	closed	Core (Other)		normal	fixed	url reverse	albertpeschar+djangotrac@… mattimustang@… dcwatson@… alexander.solovyov@… daybreaker12@… wbyoung@… django@… eric@… beau@…	Accepted	1	0	0	1	0	0
