Skip to content

Instantly share code, notes, and snippets.

@ettorerizza
Created September 22, 2018 16:59
Show Gist options
  • Save ettorerizza/6811dbfc2954da013d2a5e66c96f0959 to your computer and use it in GitHub Desktop.
Save ettorerizza/6811dbfc2954da013d2a5e66c96f0959 to your computer and use it in GitHub Desktop.
split a camel case string
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