Help for this page

Select Code to Download


  1. or download this
    chomp $ip;
    my $quad = '([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])';
    if ($string =~ /^(${quad}\.){3}${quad}$/) {
      ## have valid IP
    }
    
  2. or download this
      # $q contains the string to test
      my $quad = '([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])';
    ...
        }
        default { $type = 'name' }    # it must be a name then...
      } ## end given