import re


def _make_url_friendly(title):
    """Given a title that will be used as flavor text in a URL, returns a
    string that will look less like garbage in an address bar.
    """
    # RFC 3986 section 2.3 says: letters, numbers, and -_.~ are unreserved
    return re.sub('[^-_.~a-zA-Z0-9]', '-', title)