import re


def derive_title_link(title):
    """Derives a title sutiable for linking to"""
    title = re.sub(r'[\ ]', '_', title)
    title = re.sub(r'[^a-zA-Z0-9_~\-\.]', '', title)
    return title