开发者

Require a Regex in C#

开发者 https://www.devze.com 2022-12-21 03:30 出处:网络
I Required a Regex for the below input string: Input data - ANALYSE/xxxxxxxx: In the string xxxxxx is any characters. Need a regex accordingly to figure it out

I Required a Regex for the below input string:

Input data - ANALYSE/xxxxxxxx:

In the string xxxxxx is any characters. Need a regex accordingly to figure it out

At the end the colon is there but i need to replace entire 'ANALYSE/xxxxxxxx:' with String.empty.

I want to replace the above string with String.empty

The regex which i used 'A开发者_StackOverflowNALYSE/.*' is not getting.

Provide me a regex.


Do you really need a regex? Can't you just use

if (text.StartsWith("ANALYSE/"))

?

If you do definitely need a regex, just

ANALYSE/.*

will match appropriately. The removal side will depend on exactly what you want to do - if you could give a concrete example, that would make life easier.


Try building your own using this site: http://gskinner.com/RegExr/


Try ANALYSE/.*?:

0

精彩评论

暂无评论...
验证码 换一张
取 消