i have this script/regex that's supposed to open a file (text or html) and search for an IP address on the page in the form of say: 209.245.56.103 and put it in a variable.

part of the script is written below. the regex may be inaccurate at this time, and the script shown is just for it to print the ip address just to confirm that i've read the IP address correctly. this is not the working version, as i still have to make a lot of changes. anyway my point is, no matter what i do, could not read the IP address in any way. what is returned is the decimal equivalent of a 32bit binary number (2 to the power of 32) which is equal to: 4294967296. any hint guys is really appreciated as i really have run out of options...

The regex that I've used in the example looks for the IP in the beginning of a line contained in $ipnum (not in the $line that contains the lines read from the file). I've left this because you said the code posted was just a part of larger program and it didn't show the contents of the $ipnum... You could use the following examples in order to change the behaviour of the example from my previous post:

1. $ipnum =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/Looks for an IP in all the $ipnum, not just in the beginning; 2. $line =~ /^\s*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/Looks for an IP in the beginning if the $line that is, in the beginning of each line of the file being read; 3. $line =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/Looks for an IP in all the $line that is, IP will be found if it's contained ANYWHERE in the file;