import re


def find_line(line: str, pattern: str, i_case: bool, is_regexp=False) -> bool:
    """
    Check if line contains matches for pattern, with case and regexp flags.
    Returns True if pattern is found in line.
    """
    found = False

    if i_case:
        line = line.lower()
        pattern = pattern.lower()

    if is_regexp:
        matches = re.findall(pattern, line)
        FIND_COND = len(matches) > 0
    else:
        FIND_COND = line.find(pattern) != -1

    if FIND_COND:
        line = line.strip()
        found = True

    return found