Hedronist,
Thanks for the reply.  I tried your suggestion but it still doesn't
work.  Thanks for the link.  I'll look it over and hopefully be able
to solve the problem.

In regards to having all of my pages as close to the root as
possible.  I was reading that search engines put more importance to
pages that are closes to the root.  So that for example the following
pages:

www.mysite.com/sprint/cellular/M1000/
www.mysite.com/sprint_cellular_M1000/

>From what I understand google will think that the second second
example is more important than the first example because it's only one
level from the root.  I know that using Django there is no directory
structure.  But I guess that search engines haven't picked up on that
yet.  I'm guessing that when google finds a '/' it thinks the page is
one more level from the root which means it's less important.

Has anybody else heard of this?

On Jan 2, 9:50 am, hedronist <[EMAIL PROTECTED]> wrote:
> > Tried it...still no good
>
> When in doubt, supply specifics, as in 'exactly what is the specific
> URL you are trying to match?'
>
> The given pattern matches an appropriate URL correctly. E.g.
>
> >>> import re
> >>> x = 'foobar_abcde/'
> >>> m = re.match(r'^(?P<manufacturer>[a-zA-Z]+)_(?P<line>[a-zA-Z]+)/$', x)
> >>> print m.groupdict()
>
> {'line': 'abcde', 'manufacturer': 'foobar'}
>
> I will observe, however, that \w in your original pattern also matches
> 0-9, so if you happen to be testing with numbers in either the
> manufacturer or line portion of the URL, it ain't gonna work. It also
> won't work if you are not supplying the trailing slash.
>
> Going back to the original pattern, there is another way to write it.
> If you change your pattern from:
>       (r'^(?P<manufacturer>[\w-]+)_(?P<line>[\w-]+)/$', 'showline')
> to:
>       (r'^(?P<manufacturer>[\w-]+?)_(?P<line>[\w-]+?)/$', 'showline')
> it will work as desired.
>
> The '?' makes the '+' non-greedy, meaning it will grab as little as it
> can and still successfully match. Thus, it won't consume the '_'
> because that would cause failure.
>
> If you are relatively new to regular expressions, I strongly recommend
> perusing the Python re docs athttp://docs.python.org/lib/module-re.html.
> Read the section on syntax a few times (it can be subtle and deep),
> construct some test patterns to play with, and make sure they match
> (and don't match) as you would expect them to.
>
> Out of curiosity, what do you mean when you say "so that all of my
> pages are as close to the root as possible"? In a 'normal' web site,
> the slashes actually indicate the directory hierarchy, but in Django
> they mean ... whatever you want them to mean. Once you start having
> fun with URL mapping, the whole concept of 'the root' largely goes
> away. I now look at URLs as being procedure calls with optional
> arguments.
>
>   HTH,
>   Peter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to