I need a regex for copying domain names from text files. In text files, the domains look like
site.com - org name - title
site.net - other name - another title
HTTP://target.ca - ca site - ca title
From this text file I need
site.com
site.net
target.ca
I try sed 's/\.com\/.*/.com/' file.txt but this command only give me .com domain but I need all the domain name. Pls, help me out.
Thank you.