我有一個 Google 表格,其中包含來自 Dropbox 的數百個影像 URL,我想撰寫一個正則運算式,它將找到 URL 的所有前綴部分,而沒有檔案名 擴展名。然后,我將用另一個 url 替換搜索結果。
我擁有的:
https://www.dropbox.com/s/dtauvpuy3a5qyu4/A1001.jpg
https://www.dropbox.com/s/dtauvpuy3a5qyu4/A1001.jpg
https://www.dropbox.com/s/dtauvpuy3a5qyu4/A1001.jpg
https://www.dropbox.com/s/d0xedx0j72v5uub/A1002-1.jpg
https://www.dropbox.com/s/d0xedx0j72v5uub/A1002-1.jpg
我的期望:
https://anotherurl.com/A1001.jpg
https://anotherurl.com/A1001.jpg
https://anotherurl.com/A1001.jpg
https://anotherurl.com/A1002-1.jpg
https://anotherurl.com/A1002-1.jpg
請問,我該怎么做?
uj5u.com熱心網友回復:
假設您的原始 URL 在某個作業表的 A2:A 范圍內。完全清除其他列(例如,B:B),并將以下公式放入 B2:
=ArrayFormula(IF(A2:A="",,REGEXREPLACE(A2:A,"(. //). (/[^/] )$","$1"&"another.url"&"$2")))
在您看到的地方"another.url",您可以在引號之間手動輸入一些其他 URL 文本,或者您可以輸入新的 URL 文本是某個單元格(例如,B1)并使用單元格參考來代替:
=ArrayFormula(IF(A2:A="",,REGEXREPLACE(A2:A,"(. //). (/[^/] )$","$1"&B1&"$2")))
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/434975.html
