using System; using System.Text.RegularExpressions; public class Test { public static void Main() { Regex re = new Regex("\".*"); Console.WriteLine(re.Replace(" someAttr=\"some text here", "$&\"")); } }