my $ip = &get_IP; sub get_IP { my $ip; do { $ip = <STDIN>; chop($ip); } while $ip !~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ || $1 > 255 || $2 > 255 || $3 > 255 || $4 > 255; return $ip; }
In reply to Re: Regular Expression to Match IP Address
by TedPride
in thread Regular Expression to Match IP Address
by sashac88
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |