import re
import string


def gen_anchor(txt: str) -> str:
    """
    Generate anchor.

    Generates an anchor for a title (for internal links).

    :param txt: A string object.
    :return: A hyphen-separated string.
    """
    regex = re.compile("[%s+| ]" % re.escape(string.punctuation))
    return regex.sub("", txt.lower())