import re


def get_iter_num(fname):
    """Extracts the iteration number from the filename"""
    matches = re.match(r"^iter_(\d+).csv$", fname)

    if matches is None:
        return None

    return matches.group(1)