定期表演 [英] Regular Experssion

查看:63
本文介绍了定期表演的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有些人可以告诉我如何创建一个搜索替换.net中的常规快递

哪里会是


匹配


MY_STRING_TO_BE_CONVERTED


并替换为


MyStringToBeConverted


谢谢


托比。

Could some tell how I could create a search replace Regular Express in .net
where is would

match

MY_STRING_TO_BE_CONVERTED

and replace with

MyStringToBeConverted

Thanks

Toby.

推荐答案

托比,


为此你没有需要一个正则表达式。


MY_STRING_TO_BE_CONVERTED = MyStringToBeConverted


我认为你的意思是别的什么可以让你更清楚。


Cor
Toby,

For that you do not need a regular expression.

MY_STRING_TO_BE_CONVERTED= MyStringToBeConverted

I think you mean something else can you make that more clear.

Cor


对不起,


我的意思是更多的搜索和替换模式。它可以是任何字符串。但

格式


UPPERCASE_DELIMITED _STRING


转换为


CapitalizedUndelimitedString。


问候


托比。



" Cor Ligthert" <无********** @ planet.nl>在消息中写道

新闻:OO ************** @ TK2MSFTNGP12.phx.gbl ...
Sorry,

I mean more of the search and replace pattern. It could be any string. but
in the format

UPPERCASE_DELIMITED _STRING

coverted to

CapitalizedUndelimitedString.

Regards

Toby.


"Cor Ligthert" <no**********@planet.nl> wrote in message
news:OO**************@TK2MSFTNGP12.phx.gbl...
Toby,
为此你不需要正则表达式。

MY_STRING_TO_BE_CONVERTED = MyStringToBeConverted

我认为你的意思是别的什么可以让你更清楚。

Toby,

For that you do not need a regular expression.

MY_STRING_TO_BE_CONVERTED= MyStringToBeConverted

I think you mean something else can you make that more clear.

Cor



使用正则表达式替换您要查找的文本可能是

矫枉过正。为什么不使用.Replace函数或建议使用Cor

?在任何意义上,要使用正则表达式,您需要向system.text.regularexpressions命名空间创建一个引用

并使用其中一个共享的

函数(如regex。替换),创建一个

system.text.regularexpressions.regex的实例,或完全限定其中一个共享的

函数。


Imports System.Text.RegularExpressions

''MyTextBoxControl.Text是你的输入源

MyTextBoxControl.text = Regex.Replace(MyTextBoxControl.text,

" MY_STRING_TO_BE_CONVERTED"," MyStringToBeConverted")


" Cor Ligthert" <无********** @ planet.nl>在消息中写道

新闻:OO ************** @ TK2MSFTNGP12.phx.gbl ...
To use a Regular Expression to replace the text you are looking for might be
overkill. Why not just use the .Replace function or an assingment as Cor
suggested? In any sense, to use a regex you need to either make a reference
to the system.text.regularexpressions namespace and use one of the shared
functions (like regex.replace), create an instance of
system.text.regularexpressions.regex, or fully qualify one of the shared
functions.

Imports System.Text.RegularExpressions
''Where MyTextBoxControl.Text is your input source
MyTextBoxControl.text = Regex.Replace(MyTextBoxControl.text,
"MY_STRING_TO_BE_CONVERTED", "MyStringToBeConverted")

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:OO**************@TK2MSFTNGP12.phx.gbl...
Toby,
为此你不需要正则表达式。

MY_STRING_TO_BE_CONVERTED = MyStringToBeConverted

我认为你的意思是别的什么可以让你更清楚。

Cor
Toby,

For that you do not need a regular expression.

MY_STRING_TO_BE_CONVERTED= MyStringToBeConverted

I think you mean something else can you make that more clear.

Cor



这篇关于定期表演的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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