in reply to IPAddress check
Hello vasanth.easyrider,
This question has been asked again Validate Ip address Regexp. I would use a module such as Regexp::Common.
Sample of code from the Validate Ip address Regexp given by neilwatson
#!/usr/bin/perl use strict; use warnings; use Regexp::Common qw/ net /; my $output = "ae4.5784 up down inet 182.75.123.121/30"; if ( $output =~ m/$RE{net}{IPv4}/ ){ print "match!\n" } __END__ $ perl test.pl match!
Update: See update of fellow Monk haukex above for the correct usage.
Hope this helps, BR.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IPAddress check
by AnomalousMonk (Archbishop) on Mar 13, 2018 at 13:53 UTC | |
by thanos1983 (Parson) on Mar 13, 2018 at 14:45 UTC |