<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def string_to_basename(s):
    '''
    Converts to lowercase, removes non-alpha characters,
    and converts spaces to hyphens.
    '''
    s = s.strip().lower()
    s = re.sub(r'[^\w\s-]', '', s)
    return re.sub(r'[\s-]+', '-', s)