@staticmethod
def _is_project_a_match(project, name_str, name_regex, desc_str, desc_regex,
    any):
    """
        Given a Project, find out if it is a match for our regular expressions or strings.

        :param project: the Project to check
        :type project: Project
        :param name_str: the uppercased name of the Project to match as a string (case-insensitive) or None
        :type name_str: str
        :param name_regex: a re.compile object to call .search() to see if it matches the Project name or None
        :type name_regex: typing.Pattern
        :param desc_str: an uppercased string that is part of or the entire description (case-insensitive) or None
        :type desc_str: str
        :param desc_regex: a re.compile object to call .search() to see if it matches the Project description or None
        :type desc_regex: typing.Pattern
        :param any: if truthy, returns a True if name OR description match. Else returns true only if name AND
                    description matched
        :return: True if all non-None parameters matched the Project's name and/or description
        :rtype: bool
        """
    project_description = project.description.upper(
        ) if project.description else ''
    name_str_match = name_str is None or name_str in project.name.upper()
    name_regex_match = name_regex is None or name_regex.search(project.name)
    desc_str_match = desc_str is None or desc_str in project_description
    desc_regex_match = desc_regex is None or desc_regex.search(project.
        description)
    name_matched = name_str_match and name_regex_match
    desc_matched = desc_str_match and desc_regex_match
    if any:
        return name_matched or desc_matched
    else:
        return name_matched and desc_matched
