我正在尝试从来自 Wordpress 生成的数据库的文本字符串中删除一些 html。
我要这个:
Marnie Stanton led us through the process first and then everyone went crazy.
[caption id="attachment_76" align="alignnone" width="191"] One of the work stations[/caption]
[caption id="attachment_78" align="alignnone" width="300"] The group is getting some great results[/caption]
[caption id="attachment_83" align="alignnone" width="224"] You can see the prints multiplying[/caption]
变成这样:
Marnie Stanton led us through the process first and then everyone went crazy.
所以我想要的是从第一个[caption]
到最后一个[/caption]
被删除的所有内容。
我从这个开始:
(\[caption\s+?[^]]+\])
仅删除第一个标签。