On 01/12/2010 17:36, Carlo wrote:
Hello,

I want the Python equivalent of the Perl expression:
s/([a-z])([A-Z])/\1 \2/g
In plain language: place a space between a lowercase and uppercase
letter. I get lost in the RE module. Can someone help me?

That's easy:

    new_text = re.sub(r'([a-z])([A-Z])', r'\1 \2', old_text)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to