def text_to_pattern(text):
    """ Converts a text string into a pattern. """
    try:  # Python 3.
        return [t.encode('utf-8') for t in text.split("?")]
    except TypeError:  # Python 2.
        return [t for t in text.split("?")]