Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
string text = "[текст 1] необходимый текст [текст 2]";
Regex re = new Regex(@"\](.+)\[", RegexOptions.IgnoreCase);
Match m = re.Match(text);
// m.Groups[1].Value будет содержать необходимый вам текст.
// Нулевой элемент массива m.Groups содержит исходный текст.
Console.WriteLine(m.Groups[1].Value);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question