Can someone explain why the “1” was included in the first regex group instead of the 2nd?
Match match = Regex.Match("q10", @"(\w+)(\d+)");
//Ugh, Regex group indicies are 1-based not 0-based.
Console.WriteLine(match.Groups[1].Value); //Expected "q" got "q1"
Console.WriteLine(match.Groups[2].Value); //Expected "10" got "0"
\wmatches alphanumeric characters (and underscores).You want
[A-Za-z]