in reply to Re: Regex to catch IPV4 and IPV6 whenever ip appears withing brackets
in thread Regex to catch IPV4 and IPV6 whenever ip appears withing brackets
Hmm, Many thanks for your INPUT. Really profitable for me,
Here I TEST it with below code
#!/usr/bin/perl use strict; use warnings; use Regexp::IPv4 qw($IPv4_re); use Regexp::IPv6 qw($IPv6_re); my $ipv4_address = "192.168.0.10"; my $ipv6_address = "2600:3c00::f03c:91ff:fedf:f016"; $ipv4_address =~ /^$IPv4_re$/ and print "IPv4 address\n"; $ipv6_address =~ /^$IPv6_re$/ and print "IPv6 address\n";
Hmm. It Works
|
---|