The code below...
Code:
string sInput = @"from 2010 to 2011";
Regex reg1 = new Regex(@"\d+");
Regex reg2 = new Regex(@"(\d+)");
Match m = reg1.Match(sInput);
            
Console.WriteLine(sInput);
Console.WriteLine("Regex 1 groups ...");
foreach (Group g in m.Groups)
{
    Console.WriteLine(g.ToString());
}

m = reg2.Match(sInput);
Console.WriteLine("Regex 2 groups ...");
foreach (Group g in m.Groups)
{
    Console.WriteLine(g.ToString());
}
Gives me following result
Code:
from 2010 to 2011
Regex 1 groups ...
2010
Regex 2 groups ...
2010
2010
Can anyone explain to me why for the first regex I'm only getting 2010 and why for the second regex I'm getting 2010 twice ?