You should be able to achieve this with a "lazy" (compared to the default "greedy") ?. Try this:
Regex regex = new Regex(@"(?<g1>a?)(?<g2>a?)(?<g3>b??)(?<g4>b?)");
                  Lucero
                   2010-01-18 11:20:30
                
              You should be able to achieve this with a "lazy" (compared to the default "greedy") ?. Try this:
Regex regex = new Regex(@"(?<g1>a?)(?<g2>a?)(?<g3>b??)(?<g4>b?)");