using System;
using System.Text.RegularExpressions;
using System.Collections.Specialized;
class Program {
static void Main() {
string s1 = @"Task Predecessors:[[Relation [Task id=12 uniqueID=145 name=Alibaba1] -> [Task id=10 uniqueID=143 name=Alibaba2]], [Relation [Task id=12 uniqueID=145 name=Alibaba3] -> [Task id=11 uniqueID=144 name=Alibaba4]], [Relation [Task id=12 uniqueID=145 name=Alibaba5] -> [Task id=9 uniqueID=142 name=Alibaba6]]]";
var resultList = new StringCollection();
try {
var myRegex = new Regex(@"-> \[Task id=(\d+)");
Match matchResult = myRegex.Match(s1);
while (matchResult.Success) {
resultList.Add(matchResult.Groups[1].Value);
Console.WriteLine(matchResult.Groups[1].Value);
matchResult = matchResult.NextMatch();
}
} catch (ArgumentException ex) {
// Syntax error in the regular expression
}
Console.WriteLine("\nPress Any Key to Exit.");
Console.ReadKey();
} // END Main
} // END Program
ICAgIHVzaW5nIFN5c3RlbTsKICAgIHVzaW5nIFN5c3RlbS5UZXh0LlJlZ3VsYXJFeHByZXNzaW9uczsKICAgIHVzaW5nIFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZDsKICAgIGNsYXNzIFByb2dyYW0gewogICAgCiAgICBzdGF0aWMgdm9pZCBNYWluKCkgewogICAgc3RyaW5nIHMxID0gQCJUYXNrIFByZWRlY2Vzc29yczpbW1JlbGF0aW9uIFtUYXNrIGlkPTEyIHVuaXF1ZUlEPTE0NSBuYW1lPUFsaWJhYmExXSAtPiBbVGFzayBpZD0xMCB1bmlxdWVJRD0xNDMgbmFtZT1BbGliYWJhMl1dLCBbUmVsYXRpb24gW1Rhc2sgaWQ9MTIgdW5pcXVlSUQ9MTQ1IG5hbWU9QWxpYmFiYTNdIC0+IFtUYXNrIGlkPTExIHVuaXF1ZUlEPTE0NCBuYW1lPUFsaWJhYmE0XV0sIFtSZWxhdGlvbiBbVGFzayBpZD0xMiB1bmlxdWVJRD0xNDUgbmFtZT1BbGliYWJhNV0gLT4gW1Rhc2sgaWQ9OSB1bmlx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