def match_files ( files , pattern : Pattern ) : for name in files : if re . match ( pattern , name ) : yield name
python iterate directory for filenames with filter
Yields file name if matches a regular expression pattern .
def match_files(files, pattern: Pattern):
    """Yields file name if matches a regular expression pattern."""

    for name in files:
        if re.match(pattern, name):
            yield name