I am trying to convert camel case to space separated values using python. For example:
divLineColor -> div Line Color
This lin
\g<0> references the matched string of the whole pattern while \g<1> refereces the matched string of the first subpattern ((…)). So you should use \g<1> and \g<2> instead:
\g<0>
\g<1>
(…)
\g<2>
label = re.sub("([a-z])([A-Z])","\g<1> \g<2>",label)