- or download this
if ( ($a,$b,$c,$d) = m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ ) {
if ( $a < 256 && $b < 256 && $c < 256 && $d < 256 ) {
...
}
}
return 0;
- or download this
0.0.0.0: "0" | "0" | "0" | "0" eq "0" OK
255.255.255.255: "255" | "255" | "255" | "255" eq "255" OK
127.0.0.1: "127" | "0" | "0" | "1" eq "127" OK
- or download this
return 1 if (0+$a|0+$b|0+$c|0+$d) < 256;
- or download this
return 1 if (0|$a|$b|$c|$d) < 256;