
CGI::FormMagick::Validator::Network - network-related validation routines

use CGI::FormMagick;

See CGI::FormMagick::Validator for a general description.
The data looks like a (normalish) URL: $data =~ m!(http|ftp)://(\w/.-/+)!
isnt( url(undef, 'http://'), "OK" , "http:// is not a complete URL"); isnt( url(undef, 'ftp://'), "OK" , "ftp:// is not a complete URL"); isnt( url(undef, 'abc'), "OK" , "abc is not a valid URL"); isnt( url(), "OK" , "undef is not a valid URL"); isnt( url(undef, ''), "OK" , "empty string is not a valid URL"); is( url(undef, 'http://a.bc'), "OK" , "http://a.bc is a valid URL"); is( url(undef, 'ftp://a.bc:21/'), "OK" , "ftp://a.bc:21 is a valid URL"); isnt( url(undef, 'http:///a.bc'), "OK" , "http:///a.bc has too many slashes"); isnt( url(undef, 'http://a_a.bc'), "OK" , "Underscores are not allowed in URLs");
The data looks more or less like an internet email address: $data =~ /.+\@.+\..+/
Note: not fully compliant with the entire gamut of RFC 822 addressing ;)
The data looks like an internet domain name or hostname.
The data looks like a valid IP number.
The data looks like a good, valid username
The data looks like a good password
The data looks like a good MAC address