Extract domain from text

From LemonWiki共筆
Revision as of 15:19, 28 March 2025 by Planetoid (talk | contribs)
Jump to navigation Jump to search

Extract the domain part from URLs in article content

🌐 Switch language: English, 漢字


Using Google Sheets to extract domains

Use Google Spreadsheet REGEXEXTRACT function

=REGEXEXTRACT(A1, "(http[s]?\://[^/]+)")

Input:

Yahoo! News https://tw.news.yahoo.com/abc

Output:

https://tw.news.yahoo.com

Explanation:

  • Domain refers to text that starts with http:// or https://, followed by multiple characters that are not the symbol /: [^/]+. =