in reply to regex for classless IP subnets
Nothing glamorous, that's for sure, but it's an easy comparison.$match = 0; $ip = $ARGV[0] ? $ARGV[0] : "129.10.10.120"; ($a,$b,$c,$d) = split '\.', $ip; $match = 1 if ($a > 127 && $a < 256); print "$match\n";
|
|---|