Created
September 22, 2018 16:59
-
-
Save ettorerizza/6811dbfc2954da013d2a5e66c96f0959 to your computer and use it in GitHub Desktop.
split a camel case string
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
def camel_case_split(identifier): | |
matches = finditer('.+?(?:(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|$)', identifier) | |
return [m.group(0) for m in matches] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment