Don't try that in the wild, most sw out there would ignore spec and use some arbitrary regex to validate IP format.
i.e python:
octets = ip_str.split('.')
if len(octets) != 4:
raise AddressValueError("Expected 4 octets in %r" % ip_str)