import re


def clean_text(fulltxt_str):

    """Clean the full text of web page into the string for tokenization.

    Args:
        fulltxt_str: A string for cleaning.
    Returns:
        A processed string.
    """

    # Patterns of front matters from differnt universities.
    front_matter = r'^(.|\n)*(GMT|Content-length: [0-9]*|Content-type: text/html)'
    # Patterns of HTML elements between "<>" as well as special tokens.
    html_elem = r'<(.|\n)*?>|[\t\n\.\?]'

    res = re.sub(front_matter, ' ', fulltxt_str)
    res = re.sub(html_elem, ' ', res)
    res = re.sub('  *', ' ', res)
    return res