Extract url from text: Difference between revisions

Jump to navigation Jump to search
Line 75: Line 75:


== 從文章內容,擷取網址中的網域部分 ==
== 從文章內容,擷取網址中的網域部分 ==
=== 使用 Google sheet 擷取網域 ===
[[Extract domain from text in Mandarin | 從文章內容,擷取網址中的網域部分]]
使用 Google 試算表 [https://support.google.com/docs/answer/3098244?hl=zh-Hant REGEXEXTRACT] 函數
<pre>
=REGEXEXTRACT(A1, "(http[s]?\://[^/]+)")
</pre>
 
輸入:
<pre>
Yahoo! 新聞 https://tw.news.yahoo.com/abc
</pre>
 
輸出:
<pre>
https://tw.news.yahoo.com
</pre>
 
說明:
# 網域指以 <nowiki>http://</nowiki> 或 <nowiki>https://</nowiki> 開頭,與相臨不是符號 {{kbd | key = <nowiki>/</nowiki>}} 的多個文字:{{kbd | key = <nowiki>[^/]+</nowiki>}}。


== 從文章內容,擷取特定檔案類型的網址 ==
== 從文章內容,擷取特定檔案類型的網址 ==

Navigation menu