Fortinet Interview Question

Implement a IPv4, IPv6 string verifier