def punctuator_regex(punctuators):
    punctuator_regexes = [v[0] for v in punctuators.values()]
    punctuator_regexes.sort(lambda a, b: -cmp(len(a), len(b)))
    return '(%s)' % '|'.join(punctuator_regexes)
dataset/ETHPy150Open ardekantur/pyglet/tools/wraptypes/preprocessor.py/punctuator_regex/original