import re


def validate_text(text: str, pattern: str, max_length: int) -> bool:
    """
    Validate text based on regex pattern and maximum length allowed

    :param text: Text to validate
    :param pattern: Regular expression pattern to validate text
    :param max_length: Maximum length allowed
    :return: boolean
    """
    if len(text) > max_length:
        return False
    if re.search(pattern, text):
        return True
    return False