Extract domain from text

From LemonWiki共筆
Revision as of 15:18, 28 March 2025 by Planetoid (talk | contribs) (Created page with "Extract the domain part from URLs in article content == Using Google Sheets to extract domains == Use Google Spreadsheet [https://support.google.com/docs/answer/3098244?hl=en REGEXEXTRACT] function <pre> =REGEXEXTRACT(A1, "(http[s]?\://[^/]+)") </pre> Input: <pre> Yahoo! News https://tw.news.yahoo.com/abc </pre> Output: <pre> https://tw.news.yahoo.com </pre> Explanation: * Domain refers to text that starts with <nowiki>http://</nowiki> or <nowiki>https://</nowiki>, f...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Extract the domain part from URLs in article content

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 /: [^/]+. =