Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by jwkrahn (Abbot)
on Jul 10, 2018 at 04:54 UTC ( [id://1218215]=note: print w/replies, xml ) Need Help??


in reply to Regex to catch IPV4 and IPV6 whenever ip appears withing brackets

Perl probably has a module for that: Regexp::IPv4 Regexp::IPv6

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

Replies are listed 'Best First'.
Re^2: Regex to catch IPV4 and IPV6 whenever ip appears withing brackets
by Theodore (Friar) on Jul 10, 2018 at 08:31 UTC
Re^2: Regex to catch IPV4 and IPV6 whenever ip appears withing brackets
by theravadamonk (Scribe) on Jul 10, 2018 at 07:26 UTC

    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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-23 07:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found