using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?!(00)+)([0-9a-fA-F]{2,8})?(?!(00)+)";
string input = @"C86B0200554E0200C86B02000000000000000000270000008109000000000000EC6A050079750188810000004100002801000000000000000000010000020104000000000000000000000000000000000000000000000000F65FA45900000000FF0000002F0000000000000049000000403C9F5A000000000000000000000000FFFF330000000000000F06EAE8333536";
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