[root@localhost ~]# vim test.txt
2014-08-17
20140907
14 03 22
192.168.1.2
121.168.2.3
123-212-2-3
[root@localhost ~]# grep "[0-9]\{1,3\}[.][0-9]\{1,3\}[.][0-9]\{1,3\}[.][0-9]\{1,3\}" test.txt
192.168.1.2
121.168.2.3
[root@localhost ~]# grep "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" test.txt
192.168.1.2
121.168.2.3