import re


def extract_scale(name: str) -> list:
    """
        Extract scale out of the filename
        "[10] some_file.png" --> 10
        "[5-8] some_file.png" --> 5, 6, 7, 8
    """
    pattern = r'(?<=\[).+?(?=\])'
    data = re.search(pattern, name)

    if data is not None:
        input_number = data.group()

        if '-' in input_number:
            start = input_number.split('-')[0]
            end = input_number.split('-')[-1]
            if start.isdigit() and end.isdigit():
                start = max([1, int(start)])
                end = min([50, int(end)])
                return list(range(start, end + 1))

        elif input_number.isdigit():
            return [int(input_number)]

    return [6]