import re


def _to_anchor(value: str) -> str:
    """Convert a header string into its anchor equivalent."""
    cleaner = re.compile(r"[^A-Za-z0-9\-_]+")
    return cleaner.sub("", value.replace(" ", "-").lower())