def _toc_pattern(indexname):
 return re.compile(('^_%s_([0-9]+).toc$' % indexname))

def _toc_pattern ( indexname ) : return re . compile ( ( '^_%s_([0-9]+).toc$' % indexname ) )
returns a regular expression object that matches toc filenames .