$ is part of the regular expression. It matches the end of the line. ^ matches the beginning
So, '^polls/(\d+)/$' would match polls/1234/ but not polls/1234/1 because the ending is wrong, and not the_polls/1234/ because the beginning is wrong You can read more about this at http://docs.python.org/lib/re-syntax.html Here's how it looks at the command line: >>> import re >>> spam=re.compile(r'^polls/(\d+)/$') >>> print spam.match('polls/1234/') <_sre.SRE_Match object at 0x00AD54A0> >>> print spam.match('polls/1234/1') None >>> print spam.match('the_polls/1234/') None Since django stops matching urls after the first match, if you leave the $ off the first one will match. That's why it doesn't continue down the line. I hope this makes sense. Regular expressions sometimes take a while to get your head around. Read the docs some and play with them. Once they click, they *really* click, so don't be afraid to take some time. --B John M wrote: >Ok, so im gong through the turtorial and trying to adopt it to my own >project, and I see this in urlpatterns: > >(r`^polls/$'....), >(r'^polls/(\d+)/$'....) > >how does that differ from > >(r'^polls/'....), >(r'^polls/(\d+)/$'....) > >Note the $ is missing from the first line of the second example. > >When you don't have a $ in the polls/ setup, it doesn't scan down to >the other entries. > >Since I'm so new to python and web stuff, was wondering if anyone could >explain this. > >Sorry for such a noob question. > >Thanks > >John > > >> > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---