我想preg_replace
在TextBlock中的所有环节,让它们与字符串"<<IMAGE>>"
取代
我试图匹配此文本块中的所有链接:
"Here we can see the chupacabra trying to eat http://somesite.com/img/chupacabra.jpg.
look at the the snails somesite.com/img/snails.png"
我使用这个正则表达式:
(https?:\/\/)?.*(jpg|png|jpeg|bmp|gif)
但我不能让它只选择链接的精确匹配。
我需要的是这样的:
“在这里,我们可以在蜗牛看到卓柏卡布拉试图吃http://somesite.com/img/chupacabra.jpg
看somesite.com/img/snails.png
”
测试上regexpal.com
这不是一个新的“问题”。请先搜索。 – 2013-02-05 01:29:36