+ $_[0] =~ s|/\d+$||;
+ # if ($ptonok) {
+ # if ($_[0] =~ /:/) {
+ # if (inet_pton(AF_INET6, $_[0])) {
+ # return ($_[0] =~ /([:0-9a-f]+)/);
+ # }
+ # } else {
+ # if (inet_pton(AF_INET, $_[0])) {
+ # return ($_[0] =~ /([\.\d]+)/);
+ # }
+ # }
+ # } else {
+ if ($_[0] =~ /:/) {
+ return ($_[0] =~ /^((?:\:?\:?[0-9a-f]{0,4}){1,8}\:?\:?)$/i);
+ } else {
+ return ($_[0] =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/);
+ }
+# }
+ return undef;