如何使用正则表达式替换php中的组?

如何使用正则表达式替换php中的组?,php,regex,tags,preg-replace,Php,Regex,Tags,Preg Replace,我有这样一个字符串: [img]http://placehold.it/350x150[/img] [img]http://placehold.it/350x250[/img] 我想抓住实际的链接,并把它放在一个img <img src="http://placehold.it/350x150" /> <img src="http://placehold.it/350x250" /> 我不确定巫婆一号是不是更好的选择 我也在尝试为[视频]做同样的事情http://ww

我有这样一个字符串:

[img]http://placehold.it/350x150[/img] [img]http://placehold.it/350x250[/img]
我想抓住实际的链接,并把它放在一个img

<img src="http://placehold.it/350x150" /> <img src="http://placehold.it/350x250" />
我不确定巫婆一号是不是更好的选择

我也在尝试为
[视频]做同样的事情http://www.youtube.com/watch/?v=lzBxqBsEIlE[/video]

有什么想法吗

谢谢

使用。这是一个已解决的问题。

是否尝试用谷歌搜索它?
[img] with <img src=" and [/img] with " />