Read up on pattern syntax and you will understand this better but...
the pattern you need is
/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
which is basically saying, "look for 0-9 from 1 to 3 times, then look for a dot." Then we just repeat the pattern 3 more times (all four octets of an ip address.) If you are sure the ip address will not come as the first or last "word" in your string to search you can stipulate a word boundary before and after for a more fool-proof result like
/\b[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\b/
Cheers!