Created
July 27, 2013 12:59
-
-
Save lw/6094802 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def camelcase_to_underscore(name): | |
return "_".join(w.lower() for w in re.findall("(?:[A-Z][a-z]+|[A-Z]+(?:$|(?=[A-Z][a-z])))", name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment