egrep โ€˜[[:digit:]]{1,3}โ€™\.'[[:digit:]]{1,3}โ€™\.'[[:digit:]]{1,3}โ€™\.'[[:digit:]]{1,3}โ€™ filename

egrep โ€œ[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}โ€ filename

Note: this will not exclude invalid IP addresses such as 500.500.500.500, but it is something to start with.

If doing a copy an paste, the single quotes need to be typed manually until I figure out how enter them correctly.