Regexp::Common::net

Regexp::Common::net is a Perl module that provide regexes for IPv4 addresses.
Download

Regexp::Common::net Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Damian Conway
  • Publisher web site:
  • http://search.cpan.org/~dconway/

Regexp::Common::net Tags


Regexp::Common::net Description

Regexp::Common::net is a Perl module that provide regexes for IPv4 addresses. Regexp::Common::net is a Perl module that provide regexes for IPv4 addresses.SYNOPSIS use Regexp::Common qw /net/; while () { /$RE{net}{IPv4}/ and print "Dotted decimal IP address"; /$RE{net}{IPv4}{hex}/ and print "Dotted hexadecimal IP address"; /$RE{net}{IPv4}{oct}{-sep => ':'}/ and print "Colon separated octal IP address"; /$RE{net}{IPv4}{bin}/ and print "Dotted binary IP address"; /$RE{net}{MAC}/ and print "MAC address"; /$RE{net}{MAC}{oct}{-sep => " "}/ and print "Space separated octal MAC address"; }Please consult the manual of Regexp::Common for a general description of the works of this interface.Do not use this module directly, but load it via Regexp::Common.This modules gives you regular expressions for various style IPv4 and MAC (or ethernet) addresses.$RE{net}{IPv4}Returns a pattern that matches a valid IP address in "dotted decimal". Note that while 318.99.183.11 is not a valid IP address, it does match /$RE{net}{IPv4}/, but this is because 318.99.183.11 contains a valid IP address, namely 18.99.183.11. To prevent the unwanted matching, one needs to anchor the regexp: /^$RE{net}{IPv4}$/.For this pattern and the next four, under -keep (See Regexp::Common):$1captures the entire match$2captures the first component of the address$3captures the second component of the address$4captures the third component of the address$5captures the final component of the address Requirements: · Perl


Regexp::Common::net Related Software