I have a perl variable $webpage which contains a multi-line string ie an index.htm page. I would like to load into another variable $ip just the ip address which is contained within the variable $webpage. I only know how to strip things out of a string such as $webpage =~ s/something to remove//g; However in this case I want to do the opposite ie match a short substring in $webpage to the pattern of '