Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Regex to catch IPV4 and IPV6 whenever ip appears withing brackets

by theravadamonk (Scribe)
on Jul 10, 2018 at 07:26 UTC ( #1218222=note: print w/replies, xml ) Need Help??


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

  • Comment on Re^2: Regex to catch IPV4 and IPV6 whenever ip appears withing brackets
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1218222]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2023-09-22 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?