Modified val_ip4_addr() to use regex matches.