egrep '^((2(5[0-5]|[0-4][[:digit:]])|1[[:digit:]]{2}|[1-9][[:digit:]]|[[:digit:]]).){3}(2(5[0-5]|[0-4][[:digit:]])|1[[:digit:]]{2}|[1-9][[:digit:]]|[[:digit:]])$' file1