def build_rule_regexp(rules):
    """
    Function that create rules base on the regexp in rulesStructured.py

    Parameters
    ----------

        rules: list
            list of filenames
            
    Returns
    -------
        list_of_rules : list
            Concatenate every extension with is respective file

    Examples
    -------
    if :
    file_name_regexp = [
        ['sub-([a-zA-Z0-9]+)_ses-([a-zA-Z0-9]+)([\\w\\-]*)_ephys'],
        ]
    then ,
    list_of_rules = [
        'sub-([a-zA-Z0-9]+)_ses-([a-zA-Z0-9]+)([\\w\\-]*)_ephys.tsv'
        ]
    """

    list_of_rules = list()
    if len(rules) == 1:
        list_of_rules = rules
    else:
        for filename in rules[:-1]:
            for extension in rules[-1]:
                list_of_rules.append(filename + str(extension))

    return list_of_rules