using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
public class Test
{
public static void Main()
{
var s = "abcde\n fghij<FooBar>";
var rx = @"(.*)<FooBar>";
var res1 = Regex.Match(s, rx, RegexOptions.Singleline);
if (res1.Success) {
Console.WriteLine(res1.Groups[1].Value);
}
rx = @"(.*)<FooBar>";
var res2 = Regex.Match(s, rx, RegexOptions.Singleline);
if (res2.Success) {
Console.WriteLine(res2.Groups[1].Value);
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLklPOwp1c2luZyBTeXN0ZW0uTGlucTsKdXNpbmcgU3lzdGVtLlRleHQuUmVndWxhckV4cHJlc3Npb25zOwoKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCXZhciBzID0gImFiY2RlXG4JCWZnaGlqPEZvb0Jhcj4iOwoJCXZhciByeCA9IEAiKC4qKTxGb29CYXI+IjsKCQl2YXIgcmVzMSA9IFJlZ2V4Lk1hdGNoKHMsIHJ4LCBSZWdleE9wdGlvbnMuU2luZ2xlbGluZSk7CgkJaWYgKHJlczEuU3VjY2VzcykgewogICAgICAgCQlDb25zb2xlLldyaXRlTGluZShyZXMxLkdyb3Vwc1sxXS5WYWx1ZSk7CgkJfQoJCXJ4ID0gQCIoLiopPEZvb0Jhcj4iOwoJCXZhciByZXMyID0gUmVnZXguTWF0Y2gocywgcngsIFJlZ2V4T3B0aW9ucy5TaW5nbGVsaW5lKTsKCQlpZiAocmVzMi5TdWNjZXNzKSB7CiAgICAgICAJCUNvbnNvbGUuV3JpdGVMaW5lKHJlczIuR3JvdXBzWzFdLlZhbHVlKTsKCQl9Cgl9Cn0=