Created
February 9, 2015 22:30
-
-
Save rvause/5b1e001a9ce7ef9e0a03 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 decamelify(string): | |
| # http://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-camel-case | |
| return re.sub( | |
| r'((?<=[a-z0-9])[A-Z]|(?!^)[A-Z](?=[a-z]))', | |
| r'_\1', | |
| string, | |
| ).lower() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment