我想從字符串中刪除多個網址。如果字符串如下:R中的正則表達式:從字符串中刪除多個網址
this is a URL http://test.com and another one http://test.com/hi and this one http://www.test.com/
它應該返回
this is a URL and another one and this one
我用下面的代碼嘗試:
gsub(" ?(f|ht)(tp)(s?)(://)(.*)[.|/](.*)", "", string)
但它返回我:
this is a URL