Using regex, extend the following python code to remove whitespaces from a string.
def remove_spaces(user_string):
    '''This function will remove all the spaces from a string'''
def remove_spaces(user_string):
    '''This function will remove all the spaces from a string'''
    user_string = re.sub(r'\s','',user_string)
    return user_string