【发布时间】:2014-07-06 00:02:43
【问题描述】:
我有以下文字:
{{ some text {{ with nested text }} and again }} and some more text over here {{remove this too}}
我想匹配最外面的 {{ }} 括号,这样我就剩下:
这里还有一些文字
这是我目前所拥有的:
var text = Regex.Replace(content, "{{[^}}]*}}",string.Empty);
有什么想法吗?任何帮助将不胜感激。
更新添加一些可能有用的链接:
{{.+?}} http://www.regexr.com/3941i
{{.+}} http://www.regexr.com/3941f
【问题讨论】: