using System.Text.RegularExpressions;
public static void Main()
Match m1 = new Regex("a()b", RegexOptions.Compiled).Match(input);
Match m2 = new Regex("a()+?b", RegexOptions.Compiled).Match(input);
Match m3 = new Regex("a(){1,}?b", RegexOptions.Compiled).Match(input);
Match m4 = new Regex("a()*?b", RegexOptions.Compiled).Match(input);
Match m5 = new Regex("a(){0,}?b", RegexOptions.Compiled).Match(input);
Match m6 = new Regex("a()+b", RegexOptions.Compiled).Match(input);
Match m7 = new Regex("a()*b", RegexOptions.Compiled).Match(input);
Console.WriteLine(m1.Success + " " + m1.Value);
Console.WriteLine(m2.Success + " " + m2.Value);
Console.WriteLine(m3.Success + " " + m3.Value);
Console.WriteLine(m4.Success + " " + m4.Value);
Console.WriteLine(m5.Success + " " + m5.Value);
Console.WriteLine(m6.Success + " " + m6.Value);
Console.WriteLine(m7.Success + " " + m7.Value);