Regexp::Common already has a regex for you. Don't stress building your own.
use Regexp::Common qw/ net number /; # these become available: # $RE{net}{IPv6} # $RE{net}{IPv4} if ( $ip =~ m/$RE{net}{IPv4}/ ){ print 'match!' }
Neil Watson
watson-wilson.ca
In reply to Re: Validate Ip address Regexp
by neilwatson
in thread Validate Ip address Regexp
by akr8986
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |