I am making a parser that parses .cs files. After the .cs file is uploaded on the website i have to parse everything that is inside the namespace of the .cs file. I want to acccomplish this with regular expressions but i have no idea how to do this since i am new to regular expressions.
How would i write a expression that outputs everything inside the first and last bracket of the .cs file? For example, this is a simple .cs file:
namespace Application
{ <----------------------------------
class Members
{
int testInt = 10;
string testString = 'test';
public void testMethod()
{
}
}
} <----------------------------------
I want to get all the code between the arrows in my code example.
I have heard and read some stuff about groups but i dont really understand it yet. I would appreciate if someone could help me.