(version)
return re.sub('[^A-Za-z0-9.]+', '-', version)
Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
Convert an arbitrary string to a standard version string
Convert an arbitrary string to a standard version string
def safe_version(version):
    """Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
    """
    version = version.replace(' ','.')
    return re.sub('[^A-Za-z0-9.]+', '-', version)
def safe_version ( version ) : version = version . replace ( ' ' , '.' ) return re . sub ( '[^A-Za-z0-9.]+' , '-' , version )