import re


def tokenize_on_token(to_tokenize, pattern, token):
    """
        Tokenizes a string based on a given pattern and desired token.
        :param to_tokenize:
        :param pattern:
        :param token:
        :return to_tokenize (now tokenized):
    """
    if re.search(pattern, to_tokenize):
        to_tokenize = re.sub(pattern, token, to_tokenize)
    return to_tokenize