using System; using System.Text.RegularExpressions; public class Test { const string Str = "30-Nov-2012 30-Nov-2012 United Kingdom, 31-Oct-2012 31-Oct-2012 United Arab Emirates, 29-Oct-2012 31-Oct-2012 India"; static readonly Regex r1 = new Regex("(\\d{4})\\s"); static readonly Regex r2 = new Regex("(?<=\\d{4})\\s"); static void TestRegex(Regex r, string s) { DateTime start = DateTime.Now; for (var i = 0 ; i != 10000 ; i++) { r.Replace(Str, s); } Console.WriteLine(DateTime.Now-start); } public static void Main() { TestRegex(r1, "$1@"); TestRegex(r2, "@"); TestRegex(r1, "$1@"); TestRegex(r2, "@"); TestRegex(r1, "$1@"); TestRegex(r2, "@"); TestRegex(r1, "$1@"); TestRegex(r2, "@"); } }