import re


def sanitize(text):
    """Replaces whitespaces with underscores and removes any special characters (not \w) and converts to lowercase"""
    return re.sub(r'\W', '', re.sub(r'\s+', '_', text)).lower()