2
Answers

string concatenation in regex C#

Ask a question
kiran kiran

kiran kiran

14y
4.6k
1

Hi,
I have this string with me.
class a : public b, public c, public d { (class syntax in C++)
Now i want to get all baseclass names in one single variable through regex in C#.
I am getting derived class name properly, but getting base class name is the issue.
I have developed this regex :
@"((class|interface)\s*?(?<classname>\w*?)(\s*?|\n*?)(\:?)(\s*?|\n*?)((public|private|protected)?(\s*?|\n*?)(?<baseclassname>\w*?)[\s|\n|\,]*?)*?(\{))"

Can anyone help me in the same?

Answers (2)