Don't parse it. Just ask.
import socket try: socket.inet_aton(addr) # legal except socket.error: # Not legal
1.4m articles
1.4m replys
5 comments
57.0k users