I am not sure if you want all the octets or only some of them. This gets all the octets regardless of how many there are in each IP:

Code

while($header =~ m/\b((\.?\d{1,3})+)\b/g){ print $1,"\n"; }

if you wanted to match less octets change + to {3} or whatever number of octets per IP you want to match. Your regexp might not be well written using the \b anchor because the dot in each IP is part of \b. If the IP addresses are delimited by a space in $header using \s or \s+ might be a better boundary anchor. -------------------------------------------------

Hey kevinR thnks a ton buddy :) I solved the mystery !!! I just had some new issue , it will be great if you can help me with that

You're welcome but I see no need to delete your posts. It makes me suspicious you are cheating on something and don't want your boss/teacher to find it with a google search. -------------------------------------------------