Just Code‎ > ‎

C# - Tiny regex sample to get value from matched group

posted Feb 14, 2010, 3:43 AM by Peter Henell

Regex r = new Regex(@"\[(?<id>[0-9]*)\]", RegexOptions.Compiled);
            Console.WriteLine(r.Match(input).Result("${id}"));
Comments