def _match_file_path(path, level, v):
    """Helper function to match part."""
    if v == '*' or v is True:
        try:
            path[level]
            return True
        except IndexError:
            return False
    else:
        return path[level] == v
