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

Re: [FWP] IP address regex golf



>>>>> "UG" == Uri Guttman <uri@sysarch.com> writes:

  UG> 	/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/&($1|$2|$3|$4)<256

and to top mine, anyone notice any redundancy in that regex? try this
out:

	/^@{[q<(\d+)\.>x3]}(\d+)$/&($1|$2|$3|$4)<256

i was testing in the shell which is why the q<> so converting to single
quotes reduces it by 1

	/^@{['(\d+)\.'x3]}(\d+)$/&($1|$2|$3|$4)<256

i tried to use ${\} to interpolate but i needed parens around the whole
x expression so the @{[]} is one char shorter.

uri (still dictator^Wdirector of the PGA)

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com

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