开发者

Regular expression to get text inside parenthesis

I going to admit that I am hopeless at writing regular expressions. So can anyone please offer assistance in writing an expression (in C#) that will match the following cases:

value(Plugin.Tests.Business.Services.Repositories.Maps.SomeTests+<>c__DisplayClass2).
value(Plugin.Tests.Business.Interfaces.SomeOtherClass+<开发者_JAVA技巧>c__DisplayClass3).

Ideally I'd like anything between the brackets to be matched. Thanks for your assistance.


Regex r = new Regex(@"^value\((.*)\)\.$");


I would suggest investing in a tool like RegexBuddy. Give it a free trial.


Assuming you don't have any parentheses inside the substring:

Regex re = new Regex(@"^value\([^\)]+\)\.$");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜