Regex reg1 = new Regex(@"((?:(?!<\/h1>)[\s\S])*)<\/h1>");string str = reg1.Replace("sdfsdfsdf","$1");Console.WriteLine(str);