rtf = "Testing Image Embading
\r\n
\r\nEmage Embabeded here\r\n" Regex exp = new Regex(@"img (alt=\.)?([^\.]+)\.png", RegexOptions.IgnoreCase); string InputText = rtf; MatchCollection MatchList = exp.Matches(InputText); Match FirstMatch = MatchList[0]; for (int i = 0; i < MatchList.Count; i++) { string str = @"\"; string rtf1 = rtf.Replace("alt=\"\" src=\"/Web%20Cleint/Home%20Page/Images/Stop.png\"", rep); string strToReplace; //= MatchList[i].ToString(); //;+ str; //strToReplace = strToReplace.Substring(0, strToReplace.Length); strToReplace = string.Format(@"{0}\", MatchList[i].ToString()); rtf = rtf.Replace(strToReplace, rep); i hard corded rtf1 and it worked fine so what i want is for strToReplace to be equal to this string Web%20Cleint/Home%20Page/Images/Stop.png\" and im trying to achieve that by using this string string strToReplace; //= MatchList[i].ToString() + str; it appends 2 \\ and doesnt match the other string I hope this will help.