Re: Having a Regex Problem...

2002-06-05 Thread David T-G
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

Re: Having a Regex Problem...

2002-06-05 Thread Jeff 'japhy' Pinyan
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,

Having a Regex Problem...

2002-06-05 Thread Michael Norris
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