RegEx - 如何摆脱这两个括号之间的所有内容,包括括号?
我在编写正则表达式方面没有取得任何进展,需要一些帮助。
我需要去掉两个括号之间的所有内容,包括两个括号。
我已经尝试了我能想到的一切,但没有运气。
<cfscript>
MyString = "Eat some [pizza] with beer.";
MyString = reReplaceNoCase(MyString, "", "", "all");
writeOutput(MyString);
</cfscript>
在文本编辑器中,我使用了以下字符串,它运行得很好,但我无法让它在 ColdFusion 中运行。
^[*^]
你能帮助我吗?
I am making NO headway in writing a regular expression and need some help.
I need to get rid of everything between two brackets including the two brackets.
I have tried everything I could think of with no luck.
<cfscript>
MyString = "Eat some [pizza] with beer.";
MyString = reReplaceNoCase(MyString, "", "", "all");
writeOutput(MyString);
</cfscript>
In a text editor, I was using the following string and it worked perfectly well, but I can't get it working in ColdFusion.
^[*^]
Can you help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须转义括号,否则它们将被解释为“这些括号内的任何字符”
You have to escape the brackets or they will be interpreted as "any character inside these brackets"