import re


def validator(ip):
    """
    check if a given ip follows ip regex pattern
    :param ip: string to validate
    :return: true if the string follows the ip regex pattern,
    otherwise return false
    """
    if re.match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", ip) is not None:
        return True
    return False