> If I want to validate certain IP Address range
> say in an IP Address range of :  "15.70.186.15-100",
> here where 15.70.186 is the network id and 15-100 is
> the host id. I want to discover all IP Addresses that
> fall in between 15.86.70.15 - 15.70.186.100 .
> what regexp do i need to use ?


Do you really need to use regular expression? If in future you will change IP range you should rewrite regex. Regexes are not too sutaible to deal with range checking (it is possible but the expression is not human-friendly).


I think the best is to write a two-line function such as

sub check_ip_range{
   my @ip = $_[0] =~ /^15\.70\.186\.(\d+)$/;
   return ($ip[3] >= 15 && $ip[3] <= 100);
}


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to