Changes between Initial Version and Version 1 of Ticket #26621


Ignore:
Timestamp:
May 26, 2016, 1:39:43 PM (8 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26621

    • Property Component Uncategorizedcontrib.admindocs
    • Property Triage Stage UnreviewedAccepted
    • Property Summary simplify_regex having problems with named capture groupssimplify_regex handles named capture groups incorrectly
    • Property Type UncategorizedBug
  • Ticket #26621 – Description

    initial v1  
    1 For example using the regex from [here](http://www.django-rest-framework.org/api-guide/versioning/):
    2 
     1For example using a regex from [http://www.django-rest-framework.org/api-guide/versioning/  Django Rest Framework docs]:
    32
    43{{{
    5 simplify_regex(r'^(?P<version>(v1|v2))/bookings/(?P<pk>[0-9]+)/$')
    6 
     4>>> from django.contrib.admindocs.views import simplify_regex
     5>>> simplify_regex(r'^(?P<version>(v1|v2))/bookings/(?P<pk>[0-9]+)/$')
    76'/<version>)/bookings/<pk>/'
    87}}}
    98
     9The closing parenthesis in the output is unexpected.
     10
    1011Escaping the `/` does not seem to help.
Back to Top