from typing import Any


def regex(query: Any, field_name: str, object: Any) -> bool:
    """
    Checks if query pattern is present in value of object
    """
    return bool(list(query.findall(str(getattr(object, field_name)))))