import re

CENSORING_SEQUENCE = r'[*@%]+'
ALPHANUMERIC_SEQUENCE = r'[а-яА-ЯёЁa-zA-Z036π€b]+'
ANY_CHARACTERS_PATTERN = '.*'

CENSORING_SEQUENCE_TEMPLATE = re.compile(CENSORING_SEQUENCE)
CENSORED_TOKEN_STRICT_TEMPLATE = re.compile(f'{ALPHANUMERIC_SEQUENCE}(?:{CENSORING_SEQUENCE}{ALPHANUMERIC_SEQUENCE})+')


def to_template(word: str):
    return CENSORING_SEQUENCE_TEMPLATE.sub(ANY_CHARACTERS_PATTERN, word)
