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

Re: [FWP] IP address regex golf



Jeff Pinyan wrote:
> 
> A different flavor of the beast:
> 
>     do{$1>255||$b++>3and$a=1while/\G(\d+)(\.|$)/g;!$a};

    4==grep $_<256,/\G(\d+)(?:\.|$)/g;

or if we want to be picky:

    4==grep $_<256,/\G(\d+)(?:\.|\z)/g;

-- 
Rick Delaney
rick.delaney@home.com

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