import re


def ipv4_address_validator(addr):
    """
    Regex to validate an ipv4 address.
    Checks if each octet is in range 0-255.
    Returns True/False
    """

    pattern = re.compile(
        r"^([1]?\d?\d|2[0-4]\d|25[0-5])\.([1]?\d?\d|2[0-4]\d|25[0-5])\.([1]?\d?\d|2[0-4]\d|25[0-5])\.([1]?\d?\d|2[0-4]\d|25[0-5])$"
    )
    if pattern.fullmatch(str(addr).strip().strip("\n")):
        return True
    else:
        return False