On Aug 10, 2009, at 1:56 PM, J0hnsmith wrote:

>
> Which should I use to match a slug made using slugify?
>
> (?P<slug>[a-zA-Z0-9-]+)
>
> or
>
> (?P<slug>[\w-]+)

They're not exactly the same. Most of the time \w is alphanumeric (ie  
equivalent to your first regex) but Django compiles the  
RegexURLPattern with the UNICODE flag, which means that \w will match  
the numbers, plus anything that could be considered a Unicode  
character. At least, that's my understanding.

Hope that answers your question,
Eric

>
> >


--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to