0
我使用Regexpal.com,我看到這個SO Question怎樣的preg_replace所有鏈接到鏡像文件(*和*沒有HTTPS?)
我想不匹配的字符串。
我需要用字符串 <<IMAGE:{link}>>
preg_replace所有鏈接到圖像的鏈接。 所以我想用(https?:\/\/)?\S*(jpg|png|jpeg|bmp|gif)
OR
有同樣的事情,荷蘭國際集團,但without
前面的(HTTPS://)
使:
Hi there this is an image link https://facebook.com/images/2323.jpg
and this one is too mysite.org/1.png
將成爲:
Hi there this is an image link
<<IMAGE:https://facebook.com/images/2323.jpg>> and this one is too
<<IMAGE:mysite.org/1.png>>
@阿爾瓦羅·維卡里奧G.用的OR'ing *無*(HTTPS?) – Ted
你是什麼意思與 「試圖不匹配字符串」?除此之外,已有[關於此主題的許多問題](https://www.google.com/search?q=stack+overflow+php+find+urls+in+text)。 –
這是一段文字,而不是需要解析的鏈接 – Ted