Extract domain from text: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
(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...")
 
No edit summary
Line 1: Line 1:
Extract the domain part from URLs in article content
Extract the domain part from URLs in article content
{{LanguageSwitcher | content = [[Extract domain from text | English]], [[Extract domain from text in Mandarin | 漢字]] }}


== Using Google Sheets to extract domains ==
== Using Google Sheets to extract domains ==

Revision as of 15:19, 28 March 2025

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