Help for this page

Select Code to Download


  1. or download this
    $pattern = '[01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]';
    
    /(?:(${pattern})\.){3}($pattern)/;  # "$1.$2.$3.$4" = IP if matched
    
  2. or download this
    sub get_octets {
        my @octets = split(/\./, shift);
    ...
    
        return @octets;
    }