How Regular expressions used in Python?

The regular expressions in python are useful for searching , replacing and parsing text , numbers and words in python.

Here are the regular expressions which are used most often in python

\ – backslash used to avoid the special meaning of characters.

. – dot used to select all the characters except the newline.

^ – caret used to match the start of the string.

$ – used to match the end of the string.

* – the asterick is used to match the preceding character , with number of words it follows after . For eg, for the *sa here s , sa and also s followed with any number a can be matched

+ – plus is used to match the letter s with any number of a ‘s . But it will not match the letter a alone.

? – the question mark will sa? will match either s or a.

*? , +? , ?? – can also be used so that we fetch the datas in a minimal fashion.

{num} – a{4} this can match exactly the four preceding values of a. And it does not match the any number less that four , which results saying it does not exist.

  • I think the is exactly what you’re lionokg for, unfortunately it’s new in Django 1.3. Are you able to upgrade?From the docs:django.contrib.staticfiles collects static files from each of your applications (and any other places you specify) into a single location that can easily be served in production.EDIT: As per Wogan’s comment, if you don’t want to upgrade to 1.3 then you can use the . It’s what Django’s built in staticfiles app was originally derived from.