string find/replace

Piet van Oostrum piet at vanoostrum.org
Thu Dec 2 11:17:18 EST 2010


Carlo <carlo at somewhere.com> writes:

> On 2010-12-01, Peter Otten <__peter__ at web.de> wrote:
>>>>> import re
>>>>> re.compile("([a-z])([A-Z])").sub(r"\1 \2", "camelCase")
>> 'camel Case'
>
> Very simple if you know it. Thank you!

And almost as cryptic as Perl!!
-- 
Piet van Oostrum <piet at vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
Nu Fair Trade woonartikelen op http://www.zylja.com



More information about the Python-list mailing list