From: Michel B. <mi...@bo...> - 2005-02-15 20:15:36
|
Le Mardi 15 F=E9vrier 2005 17:18, Lionel Bouton a =E9crit : > > For comparison : on the same sample how many addresses aren't recognize= d > as "dynamic / end-user" by the regexps but are by the smartc algo ? By the way, the current code is flawed, as it performs (only) the followi= ng=20 test : my @bytes =3D split(/\./, $addr); [...] # if last bytes are in fqdn, assume home-user address return $addr if $fqdn =3D~ /$bytes[3]/ and $fqdn =3D~ /$bytes[2]/; It doesn't use any delimiters around the numbers, so, for example mta213.somedomain.com [192.168.3.21] =3D> Match ! server18.net127.domain.org [172.16.18.12] =3D> Match ! mx25.isp.net [10.10.25.2] =3D> Match ! All these would be treated with their full IP address, and not as C-Class= ,=20 where it is probably not what is desired... The regexp solution I proposed fixes these flaws as well. Cheers. --=20 Michel Bouissou <mi...@bo...> OpenPGP ID 0xDDE8AC6E |