[root@test88 ~]# cat url_email.txt root@gmail.com,http://blog.peter.com,peter@qq.com [root@test88 ~]# egrep -o ‘[A-Za-z0-9._]+@[A-Za-z0-9.]+\.[A-Za-z]{2,4}‘ url_email.txt root@gmail.com peter@qq.com [root@test88 ~]# egrep -o "http://[A-Za-z0-9.]+\.[A-Za-z]{2,4}" url_email.txt http://blog.peter.com
原文:http://www.cnblogs.com/Peter2014/p/7565706.html