hi all,

a small question, I'm trying to clean up a string, replacing multiple
spaces with a single space, multiple "-"s "."s with single "-" & ".",
my current code is:

    decoded_string = re.sub('[\s]+', ' ', decoded_string)
    decoded_string = re.sub('[-]+', '-', decoded_string)
    decoded_string = re.sub('[.]+', '.', decoded_string)

I'm quite a newbie to regex, could the above code be done in a single
line of regex replacing?

pls enlightenment me, TIA :)

Regard,

- 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to