using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; public class Test { public static void Main() { var s = "You id is (1) and your number is (0000000000)"; var results = Regex.Matches(s, @"\((\d+)\)") .Cast() .Select(m => m.Groups[1].Value) .ToList(); foreach (var v in results) Console.WriteLine(v); } }