using System;
using System.Text.RegularExpressions;
using System.Collections.Specialized;
class Program {
static void Main() {
string s1 = @"[[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.Value);
Console.WriteLine(matchResult.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
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGV4dC5SZWd1bGFyRXhwcmVzc2lvbnM7CnVzaW5nIFN5c3RlbS5Db2xsZWN0aW9ucy5TcGVjaWFsaXplZDsKY2xhc3MgUHJvZ3JhbSB7CgpzdGF0aWMgdm9pZCBNYWluKCkgewpzdHJpbmcgczEgPSBAIltbUmVsYXRpb24gW1Rhc2sgaWQ9MTIgdW5pcXVlSUQ9MTQ1IG5hbWU9QWxpYmFiYTFdIC0+IFtUYXNrIGlkPTEwIHVuaXF1ZUlEPTE0MyBuYW1lPUFsaWJhYmEyXV0sIFtSZWxhdGlvbiBbVGFzayBpZD0xMiB1bmlxdWVJRD0xNDUgbmFtZT1BbGliYWJhM10gLT4gW1Rhc2sgaWQ9MTEgdW5pcXVlSUQ9MTQ0IG5hbWU9QWxpYmFiYTRdXSwgW1JlbGF0aW9uIFtUYXNrIGlkPTEyIHVuaXF1ZUlEPTE0NSBuYW1lPUFsaWJhYmE1XSAtPiBbVGFzayBpZD05IHVuaXF1ZUlEPTE0MiBuYW1lPUFsaWJhYmE2XV1dIjsKdmFyIHJlc3VsdExpc3QgPSBuZ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