import re


def clean_name_string(string_value, clean_chars='_', remove_chars='_'):
    """
    Clean given string by cleaning given clean_char and removing given remove_chars
    :param string_value: str
    :param clean_chars: str
    :param remove_chars: str
    :return: str, cleaned name
    """

    string_value = re.sub('^[^A-Za-z0-9%s]+' % clean_chars, '', string_value)
    string_value = re.sub('[^A-Za-z0-9%s]+$' % clean_chars, '', string_value)
    string_value = re.sub('[^A-Za-z0-9]', remove_chars, string_value)

    if not string_value:
        string_value = remove_chars

    return string_value