Extract domain from text: Difference between revisions
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 difference)
|
Revision as of 15:18, 28 March 2025
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 /: [^/]+. =