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.
In reply to Re: IPAddress check
by thanos1983
in thread IPAddress check
by vasanth.easyrider
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |