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

Re: [FWP] IP address regex golf



On Apr 29, Rick Delaney said:

>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;
>    4==grep $_<256,/\G(\d+)(?:\.|\z)/g;

Hooray!  Someone went with my idea.  Sigh, if only there was some variant
of grep() that does what Tom (or was it Larry) said would be like a
first() function...

-- 
MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve             japhy@pobox.com
http://www.pobox.com/~japhy/                  http://pinyaj.stu.rpi.edu/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/


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