如何用空格替换图案? [英] How to replace patters with whitespace?

查看:69
本文介绍了如何用空格替换图案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想用空格替换任何角度绑定代码。



< pre lang =c ++> {{:: binder}} / sometext





我希望上面字符串的值为:

 / sometext 





这个我需要替换{{*** *}}这种模式。



如何使用正则表达式实现此功能?



我尝试过:



正则表达式新手。我正在尝试从不同的例子中获得最佳水平。

解决方案

取决于您的语言,但对于.NET,它将是:

< pre lang =c#> string result = regex.Replace(inputText, {{。*}} );



  Dim 结果 As  字符串 = regex.Replace(inputText,  {{。*}} 



我讨厌标记![/ edit]


Hi,

I want to replace any angular binding code with blank space.

{{::binder}} /sometext



I want the value from above string is:

/sometext



for this i need to replace {{****}} this pattern.

How can i achieve this functionality using regex?

What I have tried:

New to regex. I'm trying my level best from different examples.

解决方案

Depends on your language, but for .NET it would be:

string result = regex.Replace(inputText,"{{.*}}", "");

Or

Dim result As String = regex.Replace(inputText, "{{.*}}", "")


[edit]I HATE MARKDOWN![/edit]


这篇关于如何用空格替换图案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆