preg 替换以删除 bbcode 引用
有人可以给我一个例子,说明如何删除
[QUOTE=author;3095231]
作者(作者姓名)和 3095231(帖子)。
我想使用 preg 替换,或任何类似的东西,但不确定如何使用,并且想知道一个例子,我相信它会类似于 [QUOTE=(.+?)] 其余的我就不知道了。
Could someone give me an example of how to I can remove
[QUOTE=author;3095231]
Author being the authors name, and 3095231 being the post.
I want to use preg replace, or anything similar but not sure how and was wondering for an example, I believe it would be something like [QUOTE=(.+?)]
and i don't know the rest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的正则表达式对我来说看起来几乎正确,但你必须转义括号。
假设它是用 PHP 编写的,相应的代码如下所示
Your regex looks almost right to me, you must escape the brackets though.
Assuming it's in PHP, the corresponding code would look like
您正在寻找的正则表达式是
The regular expression you're looking for is