using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?<=\w):(?=\w[^<>]*>)(?!\w+=)";
string input = @"<ns:Documents xmlns:ttn=""http://fsrar.ru/WEGAIS/ReplyNoAnswerTTN"" xmlns:ns=""http://fsrar.ru/WEGAIS/WB_DOC_SINGLE_01"" class="" FB_FW_ext BlitzScPluginAdapter"">
<ns:Owner>
<ns:FSRAR_ID>3463047</ns:FSRAR_ID>
</ns:Owner>
<ns:Document>
<ns:ReplyNoAnswerTTN xmlns:ttn=""http://fsrar.ru/WEGAIS/ReplyNoAnswerTTN"" xmlns:ns=""http://fsrar.ru/WEGAIS/WB_DOC_SINGLE_01"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">
<ttn:Consignee>030000414982</ttn:Consignee>
<ttn:ReplyDate>2020-09-09T15:30:17.893</ttn:ReplyDate>
<ttn:ttnlist xmlns:ttn=""http://fsrar.ru/WEGAIS/ReplyNoAnswerTTN"" xmlns:ns=""http://fsrar.ru/WEGAIS/WB_DOC_SINGLE_01"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">
<ttn:NoAnswer xmlns:ttn=""http://fsrar.ru/WEGAIS/ReplyNoAnswerTTN"" xmlns:ns=""http://fsrar.ru/WEGAIS/WB_DOC_SINGLE_01"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">
<ttn:WbRegID>TTN-0407756344</ttn:WbRegID>
<ttn:ttnNumber>РН00012138</ttn:ttnNumber>
<ttn:ttnDate>2020-09-05</ttn:ttnDate>
<ttn:Shipper>030000009719</ttn:Shipper>
</ttn:NoAnswer>
</ttn:ttnlist>
</ns:ReplyNoAnswerTTN>
</ns:Document>
</ns:Documents>";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx