The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::IP::Identifier::Regex - Some regular expressions used by Net::IP::Identifier

VERSION

version 0.111

SYNOPSIS

 use Net::IP::Identifier::Regex;

 my $re = Net::IP::Identifier::Regex->new;

DESCRIPTION

Net::IP::Identifier::Regex tries to 'require Regexp::Common ('net')' and extract regular expressions for matching IPv4 and IPv6 addresses. If that fails (older versions of perl may not support it), the regular expressions are built by hand, 'borrowed' from a recent a version of Regexp::Common::net.

Methods

new

Creates a new Net::IP::Identifier::Regex object. No options are recognized.

IPv4( [ $new ] )

Set/get the regular expression for matching IPv4 addresses.

IPv6( [ $new ] )

Set/get the regular expression for matching IPv6 addresses.

IP

Get IPv4/6 single IP regex.

range

Get IPv4/6 range regex (xx - xx).

cidr

Get IPv4/6 CIDR regex (xx/W).

plus

Get IPv4/6 range regex (xx + N).

netblock

Get IPv4/6 any netblock regex, but not single IPs.

IP_any

Get any IPv4/6 format regex (single IP, CIDR, range, or plus).

IPv4_cidr

Get IPv4 CIDR regex (xx/W).

IPv4_range

Get IPv4 range regex (xx - xx).

IPv4_plus

Get IPv4 range regex (xx + N).

IPv4_any

Get any IPv4 format regex (single IP, CIDR, range, or plus).

IPv6_cidr

Get IPv6 CIDR regex (xx/W).

IPv6_range

Get IPv6 range regex (xx - xx).

IPv6_plus

Get IPv6 range regex (xx + N).

IPv6_any

Get any IPv6 format regex (single IP, CIDR, range, or plus).

SEE ALSO

Net::IP::Identifier

AUTHOR

Reid Augustin <reid@hellosix.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Reid Augustin.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.