【发布时间】:2009-11-24 15:26:25
【问题描述】:
我正在尝试编写一个简单的 php 函数,它将删除字符串中两个括号之间的所有内容。
这是一个典型的字符串的样子:
[img_assist|nid=332|title=|desc=|link=none|align=left|width=70|height=61] On November 14, Katherine Grove participated in Tulane University's School of Architecture Continuing Education Conference . She presented the firm's work in a presentation titled "Cradle to Cradle Design for the Built Environment".The Tulane School of Architecture Continuing Education Conference is designed to make continuing education credits available to Tulane School of Architecture alumni and the local architecture community, with a focus on sustainable design. Kathy currently directs the firm’s pro-bono involvement with the nonprofit Make It Right project in New Orleans, including assessment of all materials used in the construction of LEED Platinum certified affordable homes in the Lower 9th Ward. She oversees the firm’s residential studio, including leading the design team for a private residential project in Northern California targeted for LEED Platinum certification
我基本上想从主目录中去掉你在开头看到的“[img_assist|nid=332|title=|desc=|link=none|align=left|width=70|height=61]”正文。
我已经使用 preg_replace 函数设置了一个 php 函数,但我无法让它工作,因为很明显我很不擅长正则表达式。
你会写什么正则表达式来选择上面括号中的位(包括括号)?
谢谢!
【问题讨论】: