Michael --
...and then Michael Norris said...
%
% This subroutine is supposed to chech the validity of an IP address. 4 numbers (1 -
255) separated by ".". But my regular expression doesn't seem to be working out for
me.
%
...
% if ($_[0] =~ m/([1-2][0..5]*[0..5]*)\.\1\.\1\.\\s*$/) {
I do
On Jun 5, Michael Norris said:
>This subroutine is supposed to chech the validity of an IP address. 4
>numbers (1 - 255) separated by ".". But my regular expression doesn't
>seem to be working out for me.
> if ($_[0] =~ m/([1-2][0..5]*[0..5]*)\.\1\.\1\.\\s*$/) {
[0..5] means [05.] -- that is,
This subroutine is supposed to chech the validity of an IP address. 4 numbers (1 -
255) separated by ".". But my regular expression doesn't seem to be working out for
me.
print "Enter IP address: ";
chomp($ip = );
&ipcheck($ip);
sub ipcheck{
if ($_[0] =~ m/([1-2][0..5]*[0..5]*)\.\1\.\1\.\\s