def dashrepl ( value ) : patt = re . compile ( r'\W' , re . UNICODE ) return re . sub ( patt , '-' , value )
replace any singular letters in python
Replace any non - word characters with a dash .
def dashrepl(value):
    """
    Replace any non-word characters with a dash.
    """
    patt = re.compile(r'\W', re.UNICODE)
    return re.sub(patt, '-', value)