import re


def title_to_slug(book_title: str) -> str:
    """Converts a book title to an alphanumeric slug."""

    book_slug: str = book_title.lower()
    book_slug = book_slug.replace(" ", "qqq")
    book_slug = re.sub(r'\W+', '', book_slug)
    book_slug = book_slug.replace('qqq', '_')
    return book_slug