On 5/8/07, gsmith <[EMAIL PROTECTED]> wrote: > I don't understand what [\w-]{1,100} and [\w-]+ are doing. Can you > please explain?
Your best bet is to consult a good reference on regular expressions; they're among the topics that "every programmer needs to understand". Jeffrey Friedl's book "Mastering Regular Expressions" is by far the best reference out there, but the documentation for Python's regular-expression module also contains a summary of the syntax: http://docs.python.org/lib/re-syntax.html In short, '\w' is a special sequence meaning "any letter or any number or an underscore"; '[-\w-]' is character class combining '\w' and a hyphen (so any character which is a hyphen, or any character which matches '\w' will match it), and the '+' means "match one or more things like this in a sequence". '\d' means "any digit". Numbers in braces specify an exact number or range of reptitions; '\d{3}' means "any sequence of three consecutive digits", while '\d{2, 4}' means "any sequence of between two and four consecutive digits". -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---