Mohsen Sarkar
Mohsen Sarkar

Reputation: 6030

RegEx pattern or algorithm to get part of string in C#

I want a easy solution to get part of string in C#.
The string structure is like C++ blocks.

class aaa{ void bbb(){ ccc {...} text1 } text2}

The string I want is to get a specified block of code like following.

string.blocks.second() : which should return :
{ ccc {...} text1 }

Upvotes: 1

Views: 112

Answers (1)

Knaģis
Knaģis

Reputation: 21485

Since you are talking about source code, you should look at C-like language parsers. They are discussed here: Parser for C#

Upvotes: 4

Related Questions