Friday, February 22, 2013

Re: url pattern correct but not working

OP didn't seem to be using the human readable part.  He had a named group for the numeric tail, but not for the rest.

Unusual, I agree, but folks are welcome to whatever url desing they want.

Bill

On Thu, Feb 21, 2013 at 5:15 PM, Arnold Krille <arnold@arnoldarts.de> wrote:
On Thu, 21 Feb 2013 15:41:12 -0500 Bill Freeman <ke1g.nh@gmail.com>
wrote:
> Not quite right either, even if it didn't have the non matched open
> parenthesis after the carat, since it would match
> "foo-bar--1234.html".
>
> Perhaps '^(?:[a-zA-Z0-9]+-)+(?P<nid>\d+).html$'
>
> (?:...) is a non-capturing group, if you're not familiar with it.

Right, thats better. But this pattern is actually matching one
non-capture-group for each - in the url? Not that this would be a
problem though.

I never yet had the need to regex a part of the
url and then not use it as argument for the view...

Have fun,

Arnold

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment