using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?:\G(?!^)|\(DATA\$0)[^()]*?,([^(),$]+)(?=(?:\$[^()]*)?\))";
string input = @"(DATA$0$34.0002,5.3114$34.0002,5.2925$34.0004,5.3214$34.0007,2.2527$34.0002,44.3604$34.0002,43.689$34.0004,38.3179$34.0007,8.1299)
(DATA$0$24.0001,5.3038,26.0001,5.3055,28,5.3078$24.0002,5.2921,26,5.2965,28.0001,5.2914$24.0003,5.3183,26.0002,5.327,28.0002,5.3176$24.0004,2.2584,26.0002,2.2686,28.0003,2.2594$24.0001,44.7754,26.0001,45.7031,28,45.9595$24.0002,43.6157,26,44.3848,28.0001,43.9697$24.0003,42.4561,26.0002,37.7686,28.0002,38.0493$24.0004,9.082,26.0002,7.9468,28.0003,8.0566)";
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