using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?:\G(?!^)(?(?=\d+(?:EXE_IN\.preparing|bbb\.xxx))(?<!\dccc\.xxx))|(?=(?:\d+(?:EXE_IN\.preparing|bbb\.xxx))+(?:\d+ccc\.xxx)+))(\d+)(EXE_IN\.preparing|bbb\.xxx|ccc\.xxx)";
string input = @"1EXE_IN.preparing2EXE_IN.preparing3EXE_IN.preparing4EXE_IN.preparing5EXE_IN.preparing6EXE_IN.preparing7bbb.xxx8ccc.xxx9ccc.xxx";
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