Use inet_pton instead of custom regex

Fewer problems FTW.