import re


def slugify(words):
    """Convert an input string into a URL-safe form, suitable for use as a "slug".

    A slug can only contain the basic alphanumeric characters (no accents) and a
    dash. Disallowed characters are converted to dashes, runs of dashes are
    reduced to a single element, and dashes at the start or end are removed.

    Args:
      words: The input to convert

    Returns:
      The slugified string.
    """
    words = words.lower()
    words = re.sub(r'[^0-9a-zA-Z-]+', '-', words)
    words = re.sub(r'^-+', '', words)
    words = re.sub(r'-+$', '', words)
    return words