by the following grep syntax I want to match all IP address in file (from ksh script)
grep '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' file
the problem: its match also words(IP) that have more then 4 octet :
1.1.1.1.1
or 192.1.1.1.160
my question
how to match VALID IP and only IP address with only 4 octets
remark: I can accept also perl - one line syntax solution (if grep dont help us)

999.999.999.999too. – cYrus Oct 24 '10 at 12:11192.1.1.1.160example: would you expect192.1.1.1or1.1.1.160or no match at all? – Arjan Oct 24 '10 at 12:54192.1.4097are valid and accepted by Linux glibc and Windows. – grawity Oct 24 '10 at 14:49