What about
<pre>
parsing_func = lambda x: x.split(' : ') if ':' in x else (x, None)
for i in reg_source.finditer(data):
  source, source_parent =  parsing_func(i.groupdict()['source'])
</pre>