我需要一个从文本文件复制域名的正则表达式。在文本文件中,域看起来像
site.com - org name - title
site.net - other name - another title
HTTP://target.ca - ca site - ca title
从这个文本文件中我需要
site.com
site.net
target.ca
我尝试了sed 's/\.com\/.*/.com/' file.txt,但是这个命令只给我.com域,但是我需要所有的域名。请帮帮我。
谢谢。