Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7920153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:06:30+00:00 2026-06-03T16:06:30+00:00

Django version: 1.5 (trunk) I’m using a positive look-ahead assertion in url pattern A,

  • 0

Django version: 1.5 (trunk)

I’m using a positive look-ahead assertion in url pattern A, which works fine by itself. But when I try to reverse url pattern B, which is completelly unrelated, I get:

ValueError: Non-reversible reg-exp portion: '(?='

Example urls:

url(r'^foo(?=bar)/', test, name= 'bla'),
url(r'bar/', test, name= 'bli'),

Triggering the error:

from django.core.urlresolvers import reverse
reverse('bli')

I found this related ticket, but didn’t make me smarter sadly
https://code.djangoproject.com/ticket/17492

Anyone can tell me what’s wrong with the code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:06:34+00:00Added an answer on June 3, 2026 at 4:06 pm

    Your code is OK, the problem is, Django can’t reverse every possible regular expression. Currently Django’s implementation of regex normalizer can’t handle at least two things: disjunction (|) and non-capturing (look-ahead, look-behind) patterns.

    So, to solve your problem, just avoid using look-ahead in your URL patterns and you’re good to go. It should be possible, after all, using plain regular expressions without all those funky extensions it is possible to represent any regular language.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the Django-auth application (Django version 1.3), I want to have my login page
I am using dcramers version of django-paypal[1]. I am trying to use PDT with
I'm using Django 1.2 trunk with South 0.7 and an AutoOneToOneField copied from django-annoying.
I have annoying problems using django-sitetree (version 0.5.1) for generating a navigation menu with
I am using django 1.2.4 (Confirmed through the shell with import django django.VERSION )
http://pastebin.com/umBiCJvp here's the traceback and settings. I'm using Django version 1.2.3.
Django (version 1.1.4 for what it's worth) is arbitrarily not finding items that are
Short version: I have a Django project under development & testing (not yet into
I use Django social-auth (omab version just to avoid any confusion with the other
I have a version controlled project located at ~/webapps/django/myproject and media files located at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.