import fnmatch


def _matching_patterns(file_path, patterns):
    """Select all patterns that match the file path."""
    return [pattern
            for pattern
            in patterns
            if fnmatch.fnmatch(file_path, pattern)]