Return to Snippet

Revision: 39693
at January 19, 2011 23:47 by jarnaldich


Initial Code
def convert(name):
    s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
    return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()

Initial URL

                                

Initial Description
Turn a string LikeThis into like_this

Initial Title
CamlCase conversion

Initial Tags
regex, python, text

Initial Language
Python