Opened 12 years ago

Closed 12 years ago

#3944 closed (duplicate)

django.core.urlresolvers.reverse_helper doesn't support full regex syntax

Reported by: forest@… Owned by: Jacob
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


reverse_helper doesn't support the full syntax offered by the Python re module. Actually, it probably can't support everything.

(Opinion: parsing regexes is difficult and dangerous; are you sure you want to do that?)

Here is my example that failed:


The current implementation does not pretend to support nested parentheses. I am slightly skeptical that this approach can deal well with the trailing ? above.


Change History (1)

comment:1 Changed 12 years ago by Malcolm Tredinnick

Resolution: duplicate
Status: newclosed

Parsing regexps is hardly dangerous. Let's keep some perspective. It is difficult and if you have a better way to do reverse matching, please post a patch.

The functionality requested here is a dupe of #2977.

Note: See TracTickets for help on using tickets.
Back to Top