import re


def extract_positivie_integer_value(text, key):
    """
    Extract an integer value for a given key in a text
    Args:
        text (str): text to extract value from
        key (str): key to extract value for
    Raises:
        ValueError: value is not a positive integer
    Returns:
        int: extraced value
    """
    found = re.search(fr'{key}=\d+', text)
    if not found:
        return None

    value = found.group(0).split('=')[1]
    try:
        integer_value = int(value)
        if integer_value < 0:
            raise ValueError()
    except ValueError:
        raise ValueError(
            f'"{key}=" must be followed by a positive integer in text')

    return integer_value