In these Python examples, why does:
>>> sub(r\'(.)\\1*\', lambda m: str(m.group()*3)+\'-\', \'abc\')
outputs
\'aaa-bbb-ccc-\'