﻿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
16362	Ignore, rather than disallow, negative lookahead assertions	charles@…	Bas Peschier	"At present, `django.utils.regexhelper.normalize()` is defined and documented to raise an exception on encountering lookahead and lookbehind matches in the name of reversability. This behaviour unnecessarily restricts the range of valid configurations.

Consider the following case:

{{{
#!python
url(r'^(?P<city>[-\w._])/', name='city-landing'),
}}}

One may wish to assert that certain inputs are *certainly not* cities, and should never match this (in my particular use case, the desired outcome is actually a `Resolver404`, such that adding an additional, earlier `url()` entry to the urlconf is not an option):

{{{
#!python
url(r'^(?!NotACity)(?P<city>[-\w._])/', name='city-landing'),
}}}

This *does* mean that `reverse('city-landing', kwargs={'name': 'NotACity'})` will result in an invalid result (a URL which, when resolved, does not in fact match the given reversed string). However, such a case clearly constitutes user error -- as the application developer trying to request a `city-landing` URL for `NotACity` is asking the impossible -- and does not constitute cause for making such patterns unsupported."	Cleanup/optimization	closed	Core (URLs)	1.3	Normal	fixed		adam@… bmihelac@… DrMeers@…	Ready for checkin	1	0	0	0	0	0
