using System.Text.RegularExpressions;
public static void Main()
string input="Hallo abc23 abc24";
string pattern = @"abc(\d+)";
Regex rgx = new Regex(pattern);
MatchCollection matches = rgx.Matches(input);
Console.WriteLine("{0} ({1} matches):", input, matches.Count);
foreach (Match match in matches){
GroupCollection groups = match.Groups;
Console.WriteLine(" " + groups[1]);