def METHOD_NAME(
    lines: str, version_patterns: list[Pattern[str]], ignore: list[Pattern[str]]
) -> str:
    """Search a set of lines to find a match for the given regex"""
    new_guess = ""
    for pattern in version_patterns:
        match = pattern.search(lines)
        if match:
            new_guess = match.group(1).strip()
            for i in ignore:
                if str(i) in str(new_guess) or str(new_guess) in str(i):
                    new_guess = ""
            break
    if new_guess != "":
        new_guess = new_guess.replace("_", ".")
        return new_guess.replace("-", ".")
    else:
        return "UNKNOWN"