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

Re: [FWP] IP address regex golf



Not a regex, but:

  require 5.6;

  $b = eval; # assuming string to test is in $_
  $a = eval '255.255.255.255';
  print( ( $a | $b ) eq $a ? "Yes\n" : "No\n" );


-- 
John Porter

A pound of cure is worth a megaton of homeopathy.


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