using System;
using System.Text .RegularExpressions ;
class Program
{
public static void Main( )
{
string text = "<SPAN class=\" m\" ><</SPAN><SPAN class=\" t\" >text</SPAN><SPAN class=\" m\" >></SPAN><SPAN class=\" tx\" >ТЕКСТ КОТОРЫЙ НУЖНО ВЫРЕЗАТЬ</SPAN><SPAN class=\" m\" ></</SPAN><SPAN class=\" t\" >text</SPAN><SPAN class=\" m\" >></SPAN>" ;
string pattern = "(?<=<SPAN class=\" tx\" >).*?(?=</SPAN>)" ;
Match match = Regex.Match ( text, pattern) ;
if ( match.Success ) Console.WriteLine ( match.Value ) ;
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGV4dC5SZWd1bGFyRXhwcmVzc2lvbnM7CiAKY2xhc3MgUHJvZ3JhbQp7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCiAgICB7CiAgICAgICAgc3RyaW5nIHRleHQgPSAiPFNQQU4gY2xhc3M9XCJtXCI+Jmx0OzwvU1BBTj48U1BBTiBjbGFzcz1cInRcIj50ZXh0PC9TUEFOPjxTUEFOIGNsYXNzPVwibVwiPiZndDs8L1NQQU4+PFNQQU4gY2xhc3M9XCJ0eFwiPtCi0JXQmtCh0KIg0JrQntCi0J7QoNCr0Jkg0J3Qo9CW0J3QniDQktCr0KDQldCX0JDQotCsPC9TUEFOPjxTUEFOIGNsYXNzPVwibVwiPiZsdDsvPC9TUEFOPjxTUEFOIGNsYXNzPVwidFwiPnRleHQ8L1NQQU4+PFNQQU4gY2xhc3M9XCJtXCI+Jmd0OzwvU1BBTj4iOwogICAgICAgIHN0cmluZyBwYXR0ZXJuID0gIig/PD08U1BBTiBjbGFzcz1cInR4XCI+KS4qPyg/PTwvU1BBTj4pIjsKICAgICAgICBNYXRjaCBtYXRjaCA9IFJlZ2V4Lk1hdGNoKHRleHQsIHBhdHRlcm4pOwogICAgICAgIGlmIChtYXRjaC5TdWNjZXNzKSBDb25zb2xlLldyaXRlTGluZShtYXRjaC5WYWx1ZSk7CiAgICB9Cn0=