AW: AW: how to make a regex for a ip address

2002-08-20 Thread Angerstein
yes, correctly > -Ursprüngliche Nachricht- > Von: Mat Harris [mailto:[EMAIL PROTECTED]] > Gesendet am: Dienstag, 20. August 2002 16:07 > An: Angerstein > Cc: [EMAIL PROTECTED] > Betreff: Re: AW: how to make a regex for a ip address > > the addresses x.x.x.255 and x.x.x.254 are not valid a

AW: AW: how to make a regex for a ip address

2002-08-20 Thread Angerstein
0.0.0.0 is not an possible ip. see O´Reilly TCP-IP or any other good Network book. There are a some "not possible" ips, because of some bit-compinations that may not appear. (Has something to do with routing I think...) (And the reserved for further development/technologies IPs hehehehehe) tr

AW: AW: how to make a regex for a ip address

2002-08-20 Thread Angerstein
That really scores... what about some bin: @ip = split (/\./); foreach $part (@ip) { $binpart = dec2bin($part) # Reports Error if not dec numeric unless ($binpart =~ /^\d{8}$/ ) { # if not exactly 8 bits print "not an IP"; } } don´t know if this works un