Quoting Brian L. Matthews (blm@halcyon.com): > >$f='(\d+)\.';/^$f$f$f(\d+)$/&($1|$2|$3|$4)<256 > > According to man inet on my ISP's Sun, the individual parts of the > text version of an IP address can be specified in octal, hex, or > decimal. This seems to be true, at least on Debian GNU/Linux: telnet 0x7f000001 Trying 127.0.0.1... Connected to 0x7f000001. Escape character is '^]'. I just realised that practically every URL-aware application I've ever written is broken :-) (@a=split/\./)&&@a<5&&!grep!/^(0x[0-9a-f]+|[0-9]+)$/,@a should match just about anything that would parse as an IP, but will also match things like 3.14159 so isn't ideal if you're trying to pull IPs out of text or something (OTOH: telnet 3.14159 Trying 3.0.55.79... :-) -- Adam Rice -- wysiwyg@glympton.airtime.co.uk -- Blackburn, Lancashire, England ==== Want to unsubscribe from Fun With Perl? Well, if you insist... ==== Send email to <fwp-request@technofile.org> with message _body_ ==== unsubscribe