Regular expression to get text inside brackets

I will admit that I am hopelessly writing regular expressions. So who can offer help 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+<>c__DisplayClass3).

      

Ideally, I would like something in between the parentheses to be matched. Thanks for your help.

+2


source to share


3 answers


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

      



+2


source


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



+1


source


Assuming there are no parentheses in the substring:

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

      

0


source







All Articles