def _is_ipv4_like(s):
 parts = s.split('.')
 if (len(parts) != 4):
  return False
 for part in parts:
  try:
   int(part)
  except ValueError:
   return False
 return True

def _is_ipv4_like ( s ) : parts = s . split ( '.' ) if ( len ( parts ) != 4 ) : return False for part in parts : try : int ( part ) except ValueError : return False return True
find if a string superficially looks like an ipv4 address .