[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] IP address regex golf



On Fri, Apr 28, 2000 at 11:24:27PM -0500, Keith Calvert Ivey wrote:

> That doesn't work.  Try 512.1.1.1, for example, or anything 
> else that has a number greater than 256 without the 256 bit 
> set.  Try this:

You have to negate the 255:

	/(\d+)\.(\d+)\.(\d+)\.(\d+)/ && !((1 | $1 | $2 | $3 | $4) & ~255

should do the trick.

  Holger


-- 
+ GnuPG || PGP key -> finger eitz@jonathan.weh.rwth-aachen.de +
+++ Debian GNU/Linux <octavian@debian.org> +++ ICQ: 2882018 +++

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe