The following code converts the camelcase to snake case:
def convertToSnakeCase(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()
How would I go about converting, where I have 3 consecutive capital letters like ISM but split it like is_my:
ThisISMyTest --------------> This_is_my_test