using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; public class Test { public static void Main() { var pattern = @"(Project\(""{[\w-]*}""\) = "")[^\s""]*("", "")[^\s""]*("", ""{[\w-]*}"")"; var inLine = "Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Common\", \"Libraries\\Common\\Common.csproj\", \"{91197577-34B9-4D46-B3FE-A8589D4380B1}\""; var replaced = Regex.Replace(inLine, pattern, @"${1}Blah${2}..\Core\Libraries\Blah\Blah.csproj$3"); Console.WriteLine(replaced); } }